From: Lennert Buytenhek Date: Thu, 18 Sep 2008 03:06:52 +0000 (+0000) Subject: phylib: phy_mii_ioctl() fixes X-Git-Tag: v2.6.28-rc1~717^2~84 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=c6d6a511d768cf7627ab54fc18f40edf85097362;p=linux-2.6-omap-h63xx.git phylib: phy_mii_ioctl() fixes Make the SIOCGMIIPHY case fall through properly (it is supposed to not only return the ID of the default PHY but also to read from that PHY), and make phy_mii_ioctl() return the same error code as generic_mii_ioctl() in case of an unsupported operation. Signed-off-by: Lennert Buytenhek Acked-by: Andy Fleming Signed-off-by: David S. Miller --- diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c index 45cc2914d34..0433fcd0094 100644 --- a/drivers/net/phy/phy.c +++ b/drivers/net/phy/phy.c @@ -366,7 +366,8 @@ int phy_mii_ioctl(struct phy_device *phydev, switch (cmd) { case SIOCGMIIPHY: mii_data->phy_id = phydev->addr; - break; + /* fall through */ + case SIOCGMIIREG: mii_data->val_out = phy_read(phydev, mii_data->reg_num); break; @@ -413,7 +414,7 @@ int phy_mii_ioctl(struct phy_device *phydev, break; default: - return -ENOTTY; + return -EOPNOTSUPP; } return 0;