提交 c6d6a511 编写于 作者: L Lennert Buytenhek 提交者: David S. Miller

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: NLennert Buytenhek <buytenh@marvell.com>
Acked-by: NAndy Fleming <afleming@freescale.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4dd56513
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册