Skip to content

Commit a599698

Browse files
hkallweitdavem330
authored andcommitted
net: phy: improve phy_init_hw
Currently the soft reset (if defined) is done only if the driver also implements the config_init callback. I think this dependency is a mistake, so let's remove it. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 21e1944 commit a599698

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/phy/phy_device.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ int phy_init_hw(struct phy_device *phydev)
10721072
/* Deassert the reset signal */
10731073
phy_device_reset(phydev, 0);
10741074

1075-
if (!phydev->drv || !phydev->drv->config_init)
1075+
if (!phydev->drv)
10761076
return 0;
10771077

10781078
if (phydev->drv->soft_reset)
@@ -1085,7 +1085,10 @@ int phy_init_hw(struct phy_device *phydev)
10851085
if (ret < 0)
10861086
return ret;
10871087

1088-
return phydev->drv->config_init(phydev);
1088+
if (phydev->drv->config_init)
1089+
ret = phydev->drv->config_init(phydev);
1090+
1091+
return ret;
10891092
}
10901093
EXPORT_SYMBOL(phy_init_hw);
10911094

0 commit comments

Comments
 (0)