[SPARC64]: Fix of_device bus_id settings.
authorDavid S. Miller <davem@sunset.davemloft.net>
Thu, 5 Oct 2006 09:07:32 +0000 (02:07 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 10 Oct 2006 00:24:52 +0000 (17:24 -0700)
They have to be unique system-wide, so use
"NAME@NODE" as the string pattern of the non-root
nodes.

Thanks to Andrew Morton for fixing the error value
checking in bus_add_device() which made this problem
finally noticable.

Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc64/kernel/of_device.c

index 7f920453577085dcd02351d6d6be16e179a2c100..d822c7c18e1f9e5b92ddb8add7ce2bd6586b72ef 100644 (file)
@@ -841,7 +841,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
        if (!parent)
                strcpy(op->dev.bus_id, "root");
        else
-               strcpy(op->dev.bus_id, dp->path_component_name);
+               sprintf(op->dev.bus_id, "%s@%08x", dp->name, dp->node);
 
        if (of_device_register(op)) {
                printk("%s: Could not register of device.\n",