summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-11-14 09:52:33 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-12-10 10:05:43 +0100
commit5f1642fc49c259d5e7674f78171fd774ed445947 (patch)
tree602c21d9f5d69d3cfe0bf75dcaed8ac3a778c206
parent0b5361a328632e64c14a54306119093a0c7fecdf (diff)
downloadbarebox-stable/v2018.12.tar.gz
of: Add .of suffix to device names from devicetreestable/v2018.12
Previous implementation used to add a number to the device names for devices registered from the device tree which did not have a 'reg' property, thus a device node named "state" resulted in a device name "state.<x>". Current implementation skips that number and we get a device named "state". This conflicts with our barebox state implementation which tries to register a device named "state" itself. We could rename the state device nodes of all our device trees, but it causes less trouble to rename the devices. This adds a ".of" suffix to the device names for devices registered from the device tree which also has the nice effect that they now can easily be recognized. Fixes: 7e497d48acbd11 ("of: Port latest of_device_make_bus_id() implementation") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Cc: Andrey Smirnov <andrew.smirnov@gmail.com> Cc: Jan Lübbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/of/platform.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 17052f4..ef8969c 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -61,14 +61,14 @@ static void of_device_make_bus_id(struct device_d *dev)
*/
reg = of_get_property(node, "reg", NULL);
if (reg && (addr = of_translate_address(node, reg)) != OF_BAD_ADDR) {
- dev_set_name(dev, dev->name ? "%llx.%s:%s" : "%llx.%s",
+ dev_set_name(dev, dev->name ? "%llx.%s:%s" : "%llx.%s.of",
(unsigned long long)addr, node->name,
dev->name);
return;
}
/* format arguments only used if dev_name() resolves to NULL */
- dev_set_name(dev, dev->name ? "%s:%s" : "%s",
+ dev_set_name(dev, dev->name ? "%s:%s" : "%s.of",
kbasename(node->full_name), dev->name);
node = node->parent;
}