ar71xx: ag71xx: fix compile error when enabling debug
[openwrt/staging/thess.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_phy.c
index daa373be693291ca5302470cfde4129a59d9e72f..e92798ceb8975618b8cb2d4b9321402833e97b1e 100644 (file)
@@ -76,24 +76,10 @@ void ag71xx_phy_stop(struct ag71xx *ag)
 
 static int ag71xx_phy_connect_fixed(struct ag71xx *ag)
 {
-       struct platform_device *pdev = ag->pdev;
-       struct device *dev = NULL;
+       struct device *dev = &ag->pdev->dev;
        struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
        int ret = 0;
 
-       if (!pdev)
-               return -ENODEV;
-
-       dev = &pdev->dev;
-
-       if (!dev)
-               return -ENODEV;
-
-       if (!ag->phy_dev) {
-               pr_err("Missing PHY for %s", dev_name(dev));
-               return -ENODEV;
-       }
-
        /* use fixed settings */
        switch (pdata->speed) {
        case SPEED_10:
@@ -141,13 +127,12 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
                if (ag->mii_bus->mdio_map[phy_addr] == NULL)
                        continue;
 
-               DBG("%s: PHY found at %s, uid=%08x\n",
-                       dev_name(dev),
-                       dev_name(&ag->mii_bus->mdio_map[phy_addr]->dev),
-                       ag->mii_bus->mdio_map[phy_addr]->phy_id);
+               phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);
 
-               if (phydev == NULL)
-                       phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);
+               DBG("%s: PHY found at %s, uid=%08x\n",
+               dev_name(dev),
+               dev_name(&ag->mii_bus->mdio_map[phy_addr]->dev),
+               (phydev) ? phydev->phy_id : 0);
 #endif
        }