Commit 430dc325 authored by Kory Maincent's avatar Kory Maincent Committed by David S. Miller

net: phy: Remove the call to phy_mii_ioctl in phy_hwstamp_get/set

__phy_hwtstamp_set function were calling the phy_mii_ioctl function
which will then use the ifreq pointer to call the hwtstamp callback.
Now that ifreq has been removed from the hwstamp callback parameters
it seems more logical to not go through the phy_mii_ioctl function and pass
directly kernel_hwtstamp_config parameter to the hwtstamp callback.

Lets do the same for __phy_hwtstamp_get function and return directly
EOPNOTSUPP as SIOCGHWTSTAMP is not supported for now for the PHYs.
Signed-off-by: default avatarKory Maincent <kory.maincent@bootlin.com>
Reviewed-by: default avatarFlorian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 446e2305
...@@ -486,7 +486,7 @@ int __phy_hwtstamp_get(struct phy_device *phydev, ...@@ -486,7 +486,7 @@ int __phy_hwtstamp_get(struct phy_device *phydev,
if (!phydev) if (!phydev)
return -ENODEV; return -ENODEV;
return phy_mii_ioctl(phydev, config->ifr, SIOCGHWTSTAMP); return -EOPNOTSUPP;
} }
/** /**
...@@ -503,7 +503,10 @@ int __phy_hwtstamp_set(struct phy_device *phydev, ...@@ -503,7 +503,10 @@ int __phy_hwtstamp_set(struct phy_device *phydev,
if (!phydev) if (!phydev)
return -ENODEV; return -ENODEV;
return phy_mii_ioctl(phydev, config->ifr, SIOCSHWTSTAMP); if (phydev->mii_ts && phydev->mii_ts->hwtstamp)
return phydev->mii_ts->hwtstamp(phydev->mii_ts, config, extack);
return -EOPNOTSUPP;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment