Skip to contentSkip to conversation

net: phy: use phy_init_hw instead of open-coding it

PATCH In review Florian Fainelli 2 participants 3 messages Nov 15, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: phy: use phy_init_hw instead of open-coding it

We already have a helper function which verifies a PHY device driver implements a config_init callback, then calls phy_scan_fixups() and ultimately calls the config_init callback. Use that instead of open coding it.

---
 drivers/net/phy/phy.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/phy/phy.c +2 -5
index 36c6994..1e5de8c 100644
@@ -360,11 +360,8 @@ int phy_mii_ioctl(struct phy_device *phydev,
 			      mii_data->reg_num, val);
 
 		if (mii_data->reg_num == MII_BMCR &&
-		    val & BMCR_RESET &&
-		    phydev->drv->config_init) {
-			phy_scan_fixups(phydev);
-			phydev->drv->config_init(phydev);
-		}
+		    val & BMCR_RESET)
+			phy_init_hw(phydev);
 		break;
 
 	case SIOCSHWTSTAMP:
Signature · 1 line
1.8.3.2
#1 lore raw
Quoted 4 lines · Le vendredi 15 novembre 2013, 06:09:53 Florian Fainelli a écrit :

We already have a helper function which verifies a PHY device driver implements a config_init callback, then calls phy_scan_fixups() and ultimately calls the config_init callback. Use that instead of open coding it.

I did not realize we were in the middle of the merge window, I will re-submit once net-next is open again since this is not a fix.

Signature · 1 line
Florian
maintainer
#2 lore raw

From: Florian Fainelli <[email protected]>
Date: Fri, 15 Nov 2013 07:03:04 +0000

Quoted 8 lines · Le vendredi 15 novembre 2013, 06:09:53 Florian Fainelli a écrit :
Quoted 4 lines

We already have a helper function which verifies a PHY device driver implements a config_init callback, then calls phy_scan_fixups() and ultimately calls the config_init callback. Use that instead of open coding it.

I did not realize we were in the middle of the merge window, I will re-submit once net-next is open again since this is not a fix.

Thank you.