Skip to content

Commit 430dc32

Browse files
kmaincentdavem330
authored andcommitted
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>
1 parent 446e230 commit 430dc32

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/net/phy/phy.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ int __phy_hwtstamp_get(struct phy_device *phydev,
486486
if (!phydev)
487487
return -ENODEV;
488488

489-
return phy_mii_ioctl(phydev, config->ifr, SIOCGHWTSTAMP);
489+
return -EOPNOTSUPP;
490490
}
491491

492492
/**
@@ -503,7 +503,10 @@ int __phy_hwtstamp_set(struct phy_device *phydev,
503503
if (!phydev)
504504
return -ENODEV;
505505

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;
507510
}
508511

509512
/**

0 commit comments

Comments
 (0)