From: juhosg Date: Fri, 11 Dec 2009 12:21:15 +0000 (+0000) Subject: ar71xx: move mdio_bus reset code X-Git-Url: https://git.rohieb.name/openwrt.git/commitdiff_plain/c9789da4c5d508c65d190c5290fc78c58fb55fd4 ar71xx: move mdio_bus reset code git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18749 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c index 88edb2fd4..be8db3e26 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c @@ -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; diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c index 0db0a4bf7..547f72edb 100644 --- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c +++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_phy.c @@ -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);