drivers/net/skge.c: Use (pr|netdev)_<level> macro helpers
[safe/jmp/linux-2.6] / drivers / net / smsc911x.c
index 20d6095..13c0b76 100644 (file)
@@ -770,29 +770,25 @@ static int smsc911x_mii_probe(struct net_device *dev)
 {
        struct smsc911x_data *pdata = netdev_priv(dev);
        struct phy_device *phydev = NULL;
-       int phy_addr;
+       int ret;
 
        /* find the first phy */
-       for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) {
-               if (pdata->mii_bus->phy_map[phy_addr]) {
-                       phydev = pdata->mii_bus->phy_map[phy_addr];
-                       SMSC_TRACE(PROBE, "PHY %d: addr %d, phy_id 0x%08X",
-                               phy_addr, phydev->addr, phydev->phy_id);
-                       break;
-               }
-       }
-
+       phydev = phy_find_first(pdata->mii_bus);
        if (!phydev) {
                pr_err("%s: no PHY found\n", dev->name);
                return -ENODEV;
        }
 
-       phydev = phy_connect(dev, dev_name(&phydev->dev),
-               &smsc911x_phy_adjust_link, 0, pdata->config.phy_interface);
+       SMSC_TRACE(PROBE, "PHY %d: addr %d, phy_id 0x%08X",
+                       phy_addr, phydev->addr, phydev->phy_id);
+
+       ret = phy_connect_direct(dev, phydev,
+                       &smsc911x_phy_adjust_link, 0,
+                       pdata->config.phy_interface);
 
-       if (IS_ERR(phydev)) {
+       if (ret) {
                pr_err("%s: Could not attach to PHY\n", dev->name);
-               return PTR_ERR(phydev);
+               return ret;
        }
 
        pr_info("%s: attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
@@ -1383,7 +1379,7 @@ static void smsc911x_set_multicast_list(struct net_device *dev)
                pdata->clear_bits_mask = (MAC_CR_PRMS_ | MAC_CR_HPFILT_);
                pdata->hashhi = 0;
                pdata->hashlo = 0;
-       } else if (dev->mc_count > 0) {
+       } else if (!netdev_mc_empty(dev)) {
                /* Enabling specific multicast addresses */
                unsigned int hash_high = 0;
                unsigned int hash_low = 0;
@@ -1408,7 +1404,7 @@ static void smsc911x_set_multicast_list(struct net_device *dev)
                        }
                        mc_list = mc_list->next;
                }
-               if (count != (unsigned int)dev->mc_count)
+               if (count != (unsigned int)netdev_mc_count(dev))
                        SMSC_WARNING(DRV, "mc_count != dev->mc_count");
 
                pdata->hashhi = hash_high;
@@ -2154,7 +2150,7 @@ static int smsc911x_resume(struct device *dev)
        return (to == 0) ? -EIO : 0;
 }
 
-static struct dev_pm_ops smsc911x_pm_ops = {
+static const struct dev_pm_ops smsc911x_pm_ops = {
        .suspend        = smsc911x_suspend,
        .resume         = smsc911x_resume,
 };