From: Vladimir Oltean Date: Thu, 8 May 2025 12:47:53 +0000 (+0300) Subject: net: dpaa_eth: simplify dpaa_ioctl() X-Git-Tag: v6.16-rc1~132^2~144^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c2d0b7da611a80596442f453dbf738623719521f;p=thirdparty%2Flinux.git net: dpaa_eth: simplify dpaa_ioctl() phylink_mii_ioctl() handles multiple ioctls in addition to just SIOCGMIIREG: SIOCGMIIPHY, SIOCSMIIREG. Don't filter these out. Also, phylink can handle the case where net_dev->phydev is NULL (like optical SFP module, fixed-link). Be like other drivers and let phylink do so without any driver-side call filtering. Signed-off-by: Vladimir Oltean Reviewed-by: Vadim Fedorenko Acked-by: Madalin Bucur Link: https://patch.msgid.link/20250508124753.1492742-4-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index 5b8d87a0bf82c..23c23cca26209 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -3139,16 +3139,9 @@ static int dpaa_hwtstamp_set(struct net_device *dev, static int dpaa_ioctl(struct net_device *net_dev, struct ifreq *rq, int cmd) { - int ret = -EINVAL; struct dpaa_priv *priv = netdev_priv(net_dev); - if (cmd == SIOCGMIIREG) { - if (net_dev->phydev) - return phylink_mii_ioctl(priv->mac_dev->phylink, rq, - cmd); - } - - return ret; + return phylink_mii_ioctl(priv->mac_dev->phylink, rq, cmd); } static const struct net_device_ops dpaa_ops = {