ar71xx: ag71xx: use base address value directly from the source
[openwrt/staging/chunkeey.git] / target / linux / ar71xx / files / drivers / net / ethernet / atheros / ag71xx / ag71xx_phy.c
index 53507ab5a39696fad840852b97f34094e69c1ed2..336143f753d4d07ce66dd55942c29d08a37877e7 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:
@@ -111,13 +97,6 @@ static int ag71xx_phy_connect_fixed(struct ag71xx *ag)
        ag->duplex = pdata->duplex;
        ag->speed = pdata->speed;
 
-       if (!ret) {
-               dev_info(dev, "connected to fixed PHY at %s [uid=%08x, driver=%s]\n",
-                           phydev_name(ag->phy_dev),
-                           ag->phy_dev->phy_id, ag->phy_dev->drv->name);
-       } else {
-               pr_err("Failed to connect to fixed PHY\n");
-       }
        return ret;
 }
 
@@ -149,9 +128,9 @@ static int ag71xx_phy_connect_multi(struct ag71xx *ag)
                        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);
+               dev_name(dev),
+               dev_name(&ag->mii_bus->mdio_map[phy_addr]->dev),
+               (phydev) ? phydev->phy_id : 0);
 
                if (phydev == NULL)
                        phydev = mdiobus_get_phy(ag->mii_bus, phy_addr);