ar71xx: move mdio_bus reset code
authorGabor Juhos <juhosg@openwrt.org>
Fri, 11 Dec 2009 12:21:15 +0000 (12:21 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Fri, 11 Dec 2009 12:21:15 +0000 (12:21 +0000)
SVN-Revision: 18749

target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c

index 88edb2fd4c93c07bbeba749205358650b0e26851..be8db3e262358ba4369467cd8bf3918220c38d99 100644 (file)
@@ -917,13 +917,6 @@ static int __init ag71xx_probe(struct platform_device *pdev)
 
        ag71xx_dump_regs(ag);
 
-       /* Reset the mdio bus explicitly */
-       if (ag->mii_bus) {
-               mutex_lock(&ag->mii_bus->mdio_lock);
-               ag->mii_bus->reset(ag->mii_bus);
-               mutex_unlock(&ag->mii_bus->mdio_lock);
-       }
-
        platform_set_drvdata(pdev, dev);
 
        return 0;
index 0db0a4bf78506fc999e3c4d35ef103945938c9f3..547f72edba997e5c7414b399ed3a7f759577d762 100644 (file)
@@ -308,6 +308,11 @@ int ag71xx_phy_connect(struct ag71xx *ag)
                return -ENODEV;
        }
 
+       /* Reset the mdio bus explicitly */
+       mutex_lock(&ag->mii_bus->mdio_lock);
+       ag->mii_bus->reset(ag->mii_bus);
+       mutex_unlock(&ag->mii_bus->mdio_lock);
+
        if (pdata->phy_mask)
                return ag71xx_phy_connect_multi(ag);