diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2019-01-19 10:43:07 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-22 14:45:41 -0800 |
commit | a5996989d5911f416f8a31cf2b3d415911febbf6 (patch) | |
tree | 44558c18265e7fe8f6633ca619f80c93d65dbbb7 | |
parent | 21e194425abd65b525fa38cbddd08ef169d5269d (diff) |
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>
-rw-r--r-- | drivers/net/phy/phy_device.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index d35038b23370..6ccc2c7cc9f6 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -1072,7 +1072,7 @@ int phy_init_hw(struct phy_device *phydev) /* Deassert the reset signal */ phy_device_reset(phydev, 0); - if (!phydev->drv || !phydev->drv->config_init) + if (!phydev->drv) return 0; if (phydev->drv->soft_reset) @@ -1085,7 +1085,10 @@ int phy_init_hw(struct phy_device *phydev) if (ret < 0) return ret; - return phydev->drv->config_init(phydev); + if (phydev->drv->config_init) + ret = phydev->drv->config_init(phydev); + + return ret; } EXPORT_SYMBOL(phy_init_hw); |