summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorGerhard Engleder <gerhard@engleder-embedded.com>2021-08-19 16:11:53 +0300
committerDavid S. Miller <davem@davemloft.net>2021-08-20 16:31:46 +0300
commit3ac8eed62596387214869319379c1fcba264d8c6 (patch)
tree675656ead78a611ce92a1a0d747312d0b26879c0 /drivers/net
parent4ed311b08a91fe0a214714605d8159fc51166982 (diff)
downloadlinux-3ac8eed62596387214869319379c1fcba264d8c6.tar.xz
net: phy: Uniform PHY driver access
struct phy_device contains a pointer to the PHY driver and nearly everywhere this pointer is used to access the PHY driver. Only mdio_bus_phy_may_suspend() is still using to_phy_driver() instead of the PHY driver pointer. Uniform PHY driver access by eliminating to_phy_driver() use in mdio_bus_phy_may_suspend(). Only phy_bus_match() and phy_probe() are still using to_phy_driver(), because PHY driver pointer is not available there. Signed-off-by: Gerhard Engleder <gerhard@engleder-embedded.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/phy/phy_device.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index ba5ad86ec826..9e2891d8e8dd 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -233,11 +233,9 @@ static DEFINE_MUTEX(phy_fixup_lock);
static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)
{
- struct device_driver *drv = phydev->mdio.dev.driver;
- struct phy_driver *phydrv = to_phy_driver(drv);
struct net_device *netdev = phydev->attached_dev;
- if (!drv || !phydrv->suspend)
+ if (!phydev->drv->suspend)
return false;
/* PHY not attached? May suspend if the PHY has not already been