0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "armada_ap_cp_helper.h"
0012 #include <linux/device.h>
0013 #include <linux/of.h>
0014 #include <linux/of_address.h>
0015
0016 char *ap_cp_unique_name(struct device *dev, struct device_node *np,
0017 const char *name)
0018 {
0019 const __be32 *reg;
0020 u64 addr;
0021
0022
0023 if (!name)
0024 return NULL;
0025
0026 reg = of_get_property(np, "reg", NULL);
0027 addr = of_translate_address(np, reg);
0028 return devm_kasprintf(dev, GFP_KERNEL, "%llx-%s",
0029 (unsigned long long)addr, name);
0030 }