diff options
| author | Vladimir Oltean <[email protected]> | 2023-04-02 12:37:54 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-04-03 09:04:27 +0000 |
| commit | ff6ac4d013e680a5e7a38ee83ca59ffe1846915d (patch) | |
| tree | 753efd7a75d769f3ccc98da95a09efa107e43e7b /net/dsa/master.c | |
| parent | net: add struct kernel_hwtstamp_config and make net_hwtstamp_validate() use it (diff) | |
| download | kernel-ff6ac4d013e680a5e7a38ee83ca59ffe1846915d.tar.gz kernel-ff6ac4d013e680a5e7a38ee83ca59ffe1846915d.zip | |
net: dsa: make dsa_port_supports_hwtstamp() construct a fake ifreq
dsa_master_ioctl() is in the process of getting converted to a different
API, where we won't have access to a struct ifreq * anymore, but rather,
to a struct kernel_hwtstamp_config.
Since ds->ops->port_hwtstamp_get() still uses struct ifreq *, this
creates a difficult situation where we have to make up such a dummy
pointer.
The conversion is a bit messy, because it forces a "good" implementation
of ds->ops->port_hwtstamp_get() to return -EFAULT in copy_to_user()
because of the NULL ifr->ifr_data pointer. However, it works, and it is
only a transient step until ds->ops->port_hwtstamp_get() gets converted
to the new API which passes struct kernel_hwtstamp_config and does not
call copy_to_user().
Signed-off-by: Vladimir Oltean <[email protected]>
Reviewed-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/dsa/master.c')
| -rw-r--r-- | net/dsa/master.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/master.c b/net/dsa/master.c index 22d3f16b0e6d..e397641382ca 100644 --- a/net/dsa/master.c +++ b/net/dsa/master.c @@ -212,7 +212,7 @@ static int dsa_master_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) * switch in the tree that is PTP capable. */ list_for_each_entry(dp, &dst->ports, list) - if (dsa_port_supports_hwtstamp(dp, ifr)) + if (dsa_port_supports_hwtstamp(dp)) return -EBUSY; break; } |
