aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/microblaze/kernel/of_device.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/microblaze/kernel/of_device.c b/arch/microblaze/kernel/of_device.c
index 717edf4ad0b4..9a0f7632c47c 100644
--- a/arch/microblaze/kernel/of_device.c
+++ b/arch/microblaze/kernel/of_device.c
@@ -13,7 +13,6 @@ void of_device_make_bus_id(struct of_device *dev)
13{ 13{
14 static atomic_t bus_no_reg_magic; 14 static atomic_t bus_no_reg_magic;
15 struct device_node *node = dev->node; 15 struct device_node *node = dev->node;
16 char *name = dev->dev.bus_id;
17 const u32 *reg; 16 const u32 *reg;
18 u64 addr; 17 u64 addr;
19 int magic; 18 int magic;
@@ -25,9 +24,8 @@ void of_device_make_bus_id(struct of_device *dev)
25 if (reg) { 24 if (reg) {
26 addr = of_translate_address(node, reg); 25 addr = of_translate_address(node, reg);
27 if (addr != OF_BAD_ADDR) { 26 if (addr != OF_BAD_ADDR) {
28 snprintf(name, BUS_ID_SIZE, 27 dev_set_name(&dev->dev, "%llx.%s",
29 "%llx.%s", (unsigned long long)addr, 28 (unsigned long long)addr, node->name);
30 node->name);
31 return; 29 return;
32 } 30 }
33 } 31 }
@@ -37,7 +35,7 @@ void of_device_make_bus_id(struct of_device *dev)
37 * counter (and pray...) 35 * counter (and pray...)
38 */ 36 */
39 magic = atomic_add_return(1, &bus_no_reg_magic); 37 magic = atomic_add_return(1, &bus_no_reg_magic);
40 snprintf(name, BUS_ID_SIZE, "%s.%d", node->name, magic - 1); 38 dev_set_name(&dev->dev, "%s.%d", node->name, magic - 1);
41} 39}
42EXPORT_SYMBOL(of_device_make_bus_id); 40EXPORT_SYMBOL(of_device_make_bus_id);
43 41
@@ -58,7 +56,7 @@ struct of_device *of_device_alloc(struct device_node *np,
58 dev->dev.archdata.of_node = np; 56 dev->dev.archdata.of_node = np;
59 57
60 if (bus_id) 58 if (bus_id)
61 strlcpy(dev->dev.bus_id, bus_id, BUS_ID_SIZE); 59 dev_set_name(&dev->dev, bus_id);
62 else 60 else
63 of_device_make_bus_id(dev); 61 of_device_make_bus_id(dev);
64 62