Skip to content

Commit c6d6a51

Browse files
buytenhdavem330
authored andcommitted
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 <[email protected]> Acked-by: Andy Fleming <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4dd5651 commit c6d6a51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/net/phy/phy.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,8 @@ int phy_mii_ioctl(struct phy_device *phydev,
366366
switch (cmd) {
367367
case SIOCGMIIPHY:
368368
mii_data->phy_id = phydev->addr;
369-
break;
369+
/* fall through */
370+
370371
case SIOCGMIIREG:
371372
mii_data->val_out = phy_read(phydev, mii_data->reg_num);
372373
break;
@@ -413,7 +414,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
413414
break;
414415

415416
default:
416-
return -ENOTTY;
417+
return -EOPNOTSUPP;
417418
}
418419

419420
return 0;

0 commit comments

Comments
 (0)