Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[powerpc.git] / drivers / net / phy / mdio_bus.c
index ad93b0d..1b236bd 100644 (file)
@@ -29,7 +29,6 @@
 #include <linux/spinlock.h>
 #include <linux/mm.h>
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/mii.h>
 #include <linux/ethtool.h>
 #include <linux/phy.h>
@@ -61,6 +60,11 @@ int mdiobus_register(struct mii_bus *bus)
        for (i = 0; i < PHY_MAX_ADDR; i++) {
                struct phy_device *phydev;
 
+               if (bus->phy_mask & (1 << i)) {
+                       bus->phy_map[i] = NULL;
+                       continue;
+               }
+
                phydev = get_phy_device(bus, i);
 
                if (IS_ERR(phydev))
@@ -79,7 +83,7 @@ int mdiobus_register(struct mii_bus *bus)
 
                        phydev->dev.parent = bus->dev;
                        phydev->dev.bus = &mdio_bus_type;
-                       sprintf(phydev->dev.bus_id, "phy%d:%d", bus->id, i);
+                       snprintf(phydev->dev.bus_id, BUS_ID_SIZE, PHY_ID_FMT, bus->id, i);
 
                        phydev->bus = bus;