diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-09-03 06:39:43 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-03 23:02:11 -0400 |
commit | 7ab0f2736bfe137a82a7084bbfb5f809da95cabd (patch) | |
tree | e305ec96eceebb285efee4b6fd307822ab257fe6 /drivers/net/tulip | |
parent | aae5e7c30fc660c50dfecbdd745799b05af90f01 (diff) |
netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementations
dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the
driver's implementation of MDIO ioctls.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r-- | drivers/net/tulip/tulip_core.c | 2 | ||||
-rw-r--r-- | drivers/net/tulip/winbond-840.c | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index b89b73c0b30b..6b2330e4206e 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -923,8 +923,6 @@ static int private_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) | |||
923 | return 0; | 923 | return 0; |
924 | 924 | ||
925 | case SIOCSMIIREG: /* Write MII PHY register. */ | 925 | case SIOCSMIIREG: /* Write MII PHY register. */ |
926 | if (!capable (CAP_NET_ADMIN)) | ||
927 | return -EPERM; | ||
928 | if (regnum & ~0x1f) | 926 | if (regnum & ~0x1f) |
929 | return -EINVAL; | 927 | return -EINVAL; |
930 | if (data->phy_id == phy) { | 928 | if (data->phy_id == phy) { |
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index 3e59397e5386..b38d3b7f6e35 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
@@ -1470,8 +1470,6 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1470 | return 0; | 1470 | return 0; |
1471 | 1471 | ||
1472 | case SIOCSMIIREG: /* Write MII PHY register. */ | 1472 | case SIOCSMIIREG: /* Write MII PHY register. */ |
1473 | if (!capable(CAP_NET_ADMIN)) | ||
1474 | return -EPERM; | ||
1475 | spin_lock_irq(&np->lock); | 1473 | spin_lock_irq(&np->lock); |
1476 | mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in); | 1474 | mdio_write(dev, data->phy_id & 0x1f, data->reg_num & 0x1f, data->val_in); |
1477 | spin_unlock_irq(&np->lock); | 1475 | spin_unlock_irq(&np->lock); |