Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Kory Maincent <kory.maincent@bootlin.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Kory Maincent and committed by
David S. Miller
430dc325 446e2305

+5 -2
+5 -2
drivers/net/phy/phy.c
··· 486 486 if (!phydev) 487 487 return -ENODEV; 488 488 489 - return phy_mii_ioctl(phydev, config->ifr, SIOCGHWTSTAMP); 489 + return -EOPNOTSUPP; 490 490 } 491 491 492 492 /** ··· 503 503 if (!phydev) 504 504 return -ENODEV; 505 505 506 - return phy_mii_ioctl(phydev, config->ifr, SIOCSHWTSTAMP); 506 + if (phydev->mii_ts && phydev->mii_ts->hwtstamp) 507 + return phydev->mii_ts->hwtstamp(phydev->mii_ts, config, extack); 508 + 509 + return -EOPNOTSUPP; 507 510 } 508 511 509 512 /**