Skip to content

Commit

Permalink
phylib: phy_mii_ioctl() fixes
Browse files Browse the repository at this point in the history
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 <buytenh@marvell.com>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Lennert Buytenhek authored and David S. Miller committed Oct 8, 2008
1 parent 4dd5651 commit c6d6a51
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -413,7 +414,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
break;

default:
return -ENOTTY;
return -EOPNOTSUPP;
}

return 0;
Expand Down

0 comments on commit c6d6a51

Please sign in to comment.