Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c6d6a511 authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by David S. Miller
Browse files

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: default avatarLennert Buytenhek <buytenh@marvell.com>
Acked-by: default avatarAndy Fleming <afleming@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4dd56513
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -366,7 +366,8 @@ int phy_mii_ioctl(struct phy_device *phydev,
	switch (cmd) {
	switch (cmd) {
	case SIOCGMIIPHY:
	case SIOCGMIIPHY:
		mii_data->phy_id = phydev->addr;
		mii_data->phy_id = phydev->addr;
		break;
		/* fall through */

	case SIOCGMIIREG:
	case SIOCGMIIREG:
		mii_data->val_out = phy_read(phydev, mii_data->reg_num);
		mii_data->val_out = phy_read(phydev, mii_data->reg_num);
		break;
		break;
@@ -413,7 +414,7 @@ int phy_mii_ioctl(struct phy_device *phydev,
		break;
		break;


	default:
	default:
		return -ENOTTY;
		return -EOPNOTSUPP;
	}
	}


	return 0;
	return 0;