diff options
Diffstat (limited to 'drivers/net/ucc_geth_mii.c')
-rw-r--r-- | drivers/net/ucc_geth_mii.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c index c001d261366b..54635911305c 100644 --- a/drivers/net/ucc_geth_mii.c +++ b/drivers/net/ucc_geth_mii.c | |||
@@ -156,7 +156,7 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma | |||
156 | if (err) | 156 | if (err) |
157 | goto reg_map_fail; | 157 | goto reg_map_fail; |
158 | 158 | ||
159 | snprintf(new_bus->id, MII_BUS_ID_SIZE, "%x", res.start); | 159 | uec_mdio_bus_name(new_bus->id, np); |
160 | 160 | ||
161 | new_bus->irq = kmalloc(32 * sizeof(int), GFP_KERNEL); | 161 | new_bus->irq = kmalloc(32 * sizeof(int), GFP_KERNEL); |
162 | 162 | ||
@@ -283,3 +283,13 @@ void uec_mdio_exit(void) | |||
283 | { | 283 | { |
284 | of_unregister_platform_driver(&uec_mdio_driver); | 284 | of_unregister_platform_driver(&uec_mdio_driver); |
285 | } | 285 | } |
286 | |||
287 | void uec_mdio_bus_name(char *name, struct device_node *np) | ||
288 | { | ||
289 | const u32 *reg; | ||
290 | |||
291 | reg = of_get_property(np, "reg", NULL); | ||
292 | |||
293 | snprintf(name, MII_BUS_ID_SIZE, "%s@%x", np->name, reg ? *reg : 0); | ||
294 | } | ||
295 | |||