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

net: amd-xgbe: use EOPNOTSUPP instead of ENOTSUPP in xgbe_phy_mii_read_c45

The MDIO read callback xgbe_phy_mii_read_c45() can propagate its return
value up through phylink_mii_ioctl() to user space via netdev ioctls such
as SIOCGMIIREG. Returning ENOTSUPP results in user space seeing
"Unknown error", since ENOTSUPP is not a standard errno value.

Replace ENOTSUPP with EOPNOTSUPP to align with the MDIO core’s
usage and ensure user space receives a proper "Operation not supported"
error instead of an unknown code.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Acked-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://patch.msgid.link/20251015025751.1532149-1-alok.a.tiwari@oracle.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Alok Tiwari and committed by
Jakub Kicinski
bd853a59 55db64dd

+1 -1
+1 -1
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
··· 668 668 else if (phy_data->conn_type & XGBE_CONN_TYPE_MDIO) 669 669 ret = xgbe_phy_mdio_mii_read_c45(pdata, addr, devad, reg); 670 670 else 671 - ret = -ENOTSUPP; 671 + ret = -EOPNOTSUPP; 672 672 673 673 xgbe_phy_put_comm_ownership(pdata); 674 674