From 12f75eeee1cc560f30f96f7e0f0c39e0d782ecd2 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Tue, 21 Nov 2006 14:56:37 +1100 Subject: [PATCH] --- yaml --- r: 42279 b: refs/heads/master c: 9309180f11f0107c9858a61a1ac2b04518a91080 h: refs/heads/master i: 42277: 00649f5363e8b1131356a6ed8998c3076a63262c 42275: ef36f36e3171c8654b0174dd26217869cb094c45 42271: 83fce2325bb51f17b4755d2fd70cfe45078d3136 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/kernel/of_platform.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 813e8d569515..c898c19e768d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 974a76f51355d22f4f63d83d6bb1ccecd019ec58 +refs/heads/master: 9309180f11f0107c9858a61a1ac2b04518a91080 diff --git a/trunk/arch/powerpc/kernel/of_platform.c b/trunk/arch/powerpc/kernel/of_platform.c index 6029543c1b5e..b3189d0161b8 100644 --- a/trunk/arch/powerpc/kernel/of_platform.c +++ b/trunk/arch/powerpc/kernel/of_platform.c @@ -27,6 +27,8 @@ #include #include #include +#include + /* * The list of OF IDs below is used for matching bus types in the @@ -51,6 +53,8 @@ static struct of_device_id of_default_bus_ids[] = { {}, }; +static atomic_t bus_no_reg_magic; + /* * * OF platform device type definition & base infrastructure @@ -165,6 +169,7 @@ static void of_platform_make_bus_id(struct of_device *dev) char *name = dev->dev.bus_id; const u32 *reg; u64 addr; + long magic; /* * If it's a DCR based device, use 'd' for native DCRs @@ -203,9 +208,11 @@ static void of_platform_make_bus_id(struct of_device *dev) } /* - * No BusID, use the node name and pray + * No BusID, use the node name and add a globally incremented + * counter (and pray...) */ - snprintf(name, BUS_ID_SIZE, "%s", node->name); + magic = atomic_add_return(1, &bus_no_reg_magic); + snprintf(name, BUS_ID_SIZE, "%s.%d", node->name, magic - 1); } struct of_device* of_platform_device_create(struct device_node *np,