]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/phy/phy_device.c
net: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6-omap-h63xx.git] / drivers / net / phy / phy_device.c
index f11e900b437b66044b422da02e26fe4a4efdeff6..e976c1c600958943ee42dd572e68d20748b84cf6 100644 (file)
@@ -74,7 +74,7 @@ int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,
        if (!fixup)
                return -ENOMEM;
 
-       strncpy(fixup->bus_id, bus_id, BUS_ID_SIZE);
+       strlcpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id));
        fixup->phy_uid = phy_uid;
        fixup->phy_uid_mask = phy_uid_mask;
        fixup->run = run;
@@ -109,7 +109,7 @@ EXPORT_SYMBOL(phy_register_fixup_for_id);
  */
 static int phy_needs_fixup(struct phy_device *phydev, struct phy_fixup *fixup)
 {
-       if (strcmp(fixup->bus_id, phydev->dev.bus_id) != 0)
+       if (strcmp(fixup->bus_id, dev_name(&phydev->dev)) != 0)
                if (strcmp(fixup->bus_id, PHY_ANY_ID) != 0)
                        return 0;
 
@@ -309,11 +309,6 @@ void phy_disconnect(struct phy_device *phydev)
 }
 EXPORT_SYMBOL(phy_disconnect);
 
-static int phy_compare_id(struct device *dev, void *data)
-{
-       return strcmp((char *)data, dev->bus_id) ? 0 : 1;
-}
-
 /**
  * phy_attach - attach a network device to a particular PHY device
  * @dev: network device to attach
@@ -337,8 +332,7 @@ struct phy_device *phy_attach(struct net_device *dev,
 
        /* Search the list of PHY devices on the mdio bus for the
         * PHY with the requested name */
-       d = bus_find_device(bus, NULL, (void *)bus_id, phy_compare_id);
-
+       d = bus_find_device_by_name(bus, NULL, bus_id);
        if (d) {
                phydev = to_phy_device(d);
        } else {