diff options
author | Andy Fleming <afleming@freescale.com> | 2008-04-09 20:38:13 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-04-16 20:09:35 -0400 |
commit | 9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0 (patch) | |
tree | 51b2ee6bfa87bbd6faac0bc00a787354e1fb72a0 /arch | |
parent | d080cd6301e107e79c6a0fc654319f8979f70549 (diff) |
phy: Change mii_bus id field to a string
Having the id field be an int was making more complex bus topologies
excessively difficult. For now, just convert it to a string, and
change all instances of "bus->id = val" to
snprintf(id, MII_BUS_ID_LEN, "%x", val).
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/82xx/ep8248e.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pasemi/gpio_mdio.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 5 |
3 files changed, 5 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/82xx/ep8248e.c b/arch/powerpc/platforms/82xx/ep8248e.c index ba93d8ae9b0c..d5770fdf7f09 100644 --- a/arch/powerpc/platforms/82xx/ep8248e.c +++ b/arch/powerpc/platforms/82xx/ep8248e.c | |||
@@ -138,7 +138,7 @@ static int __devinit ep8248e_mdio_probe(struct of_device *ofdev, | |||
138 | 138 | ||
139 | bus->name = "ep8248e-mdio-bitbang"; | 139 | bus->name = "ep8248e-mdio-bitbang"; |
140 | bus->dev = &ofdev->dev; | 140 | bus->dev = &ofdev->dev; |
141 | bus->id = res.start; | 141 | snprintf(bus->id, MII_BUS_ID_SIZE, "%x", res.start); |
142 | 142 | ||
143 | return mdiobus_register(bus); | 143 | return mdiobus_register(bus); |
144 | } | 144 | } |
diff --git a/arch/powerpc/platforms/pasemi/gpio_mdio.c b/arch/powerpc/platforms/pasemi/gpio_mdio.c index b46542990cf8..ab6955412ba4 100644 --- a/arch/powerpc/platforms/pasemi/gpio_mdio.c +++ b/arch/powerpc/platforms/pasemi/gpio_mdio.c | |||
@@ -241,7 +241,7 @@ static int __devinit gpio_mdio_probe(struct of_device *ofdev, | |||
241 | new_bus->reset = &gpio_mdio_reset; | 241 | new_bus->reset = &gpio_mdio_reset; |
242 | 242 | ||
243 | prop = of_get_property(np, "reg", NULL); | 243 | prop = of_get_property(np, "reg", NULL); |
244 | new_bus->id = *prop; | 244 | snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", *prop); |
245 | new_bus->priv = priv; | 245 | new_bus->priv = priv; |
246 | 246 | ||
247 | new_bus->phy_mask = 0; | 247 | new_bus->phy_mask = 0; |
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 2c5388ce902a..3581416905ea 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -341,7 +341,7 @@ static int __init gfar_of_init(void) | |||
341 | goto unreg; | 341 | goto unreg; |
342 | } | 342 | } |
343 | 343 | ||
344 | gfar_data.bus_id = 0; | 344 | snprintf(gfar_data.bus_id, MII_BUS_ID_SIZE, "0"); |
345 | gfar_data.phy_id = fixed_link[0]; | 345 | gfar_data.phy_id = fixed_link[0]; |
346 | } else { | 346 | } else { |
347 | phy = of_find_node_by_phandle(*ph); | 347 | phy = of_find_node_by_phandle(*ph); |
@@ -362,7 +362,8 @@ static int __init gfar_of_init(void) | |||
362 | } | 362 | } |
363 | 363 | ||
364 | gfar_data.phy_id = *id; | 364 | gfar_data.phy_id = *id; |
365 | gfar_data.bus_id = res.start; | 365 | snprintf(gfar_data.bus_id, MII_BUS_ID_SIZE, "%x", |
366 | res.start); | ||
366 | 367 | ||
367 | of_node_put(phy); | 368 | of_node_put(phy); |
368 | of_node_put(mdio); | 369 | of_node_put(mdio); |