]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: amd-xgbe: use EOPNOTSUPP instead of ENOTSUPP in xgbe_phy_mii_read_c45
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Wed, 15 Oct 2025 02:57:43 +0000 (19:57 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 22:42:10 +0000 (15:42 -0700)
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>
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c

index a56efc1bee33992d51839097015a7efe1609f656..35a381a83647d7390d6b65c65062bfdc30cced48 100644 (file)
@@ -668,7 +668,7 @@ static int xgbe_phy_mii_read_c45(struct mii_bus *mii, int addr, int devad,
        else if (phy_data->conn_type & XGBE_CONN_TYPE_MDIO)
                ret = xgbe_phy_mdio_mii_read_c45(pdata, addr, devad, reg);
        else
-               ret = -ENOTSUPP;
+               ret = -EOPNOTSUPP;
 
        xgbe_phy_put_comm_ownership(pdata);