aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2009-09-03 06:39:43 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-03 23:02:11 -0400
commit7ab0f2736bfe137a82a7084bbfb5f809da95cabd (patch)
treee305ec96eceebb285efee4b6fd307822ab257fe6 /drivers/net/pcmcia
parentaae5e7c30fc660c50dfecbdd745799b05af90f01 (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/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c2
-rw-r--r--drivers/net/pcmcia/axnet_cs.c2
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c2
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c2
4 files changed, 0 insertions, 8 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 382d26520acc..d836af1b9034 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -1124,8 +1124,6 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1124 int saved_window; 1124 int saved_window;
1125 unsigned long flags; 1125 unsigned long flags;
1126 1126
1127 if (!capable(CAP_NET_ADMIN))
1128 return -EPERM;
1129 spin_lock_irqsave(&lp->window_lock, flags); 1127 spin_lock_irqsave(&lp->window_lock, flags);
1130 saved_window = inw(ioaddr + EL3_CMD) >> 13; 1128 saved_window = inw(ioaddr + EL3_CMD) >> 13;
1131 EL3WINDOW(4); 1129 EL3WINDOW(4);
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 3b681c1d7523..4f2fef6cf6dc 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -706,8 +706,6 @@ static int axnet_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
706 data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f); 706 data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f);
707 return 0; 707 return 0;
708 case SIOCSMIIREG: /* Write MII PHY register. */ 708 case SIOCSMIIREG: /* Write MII PHY register. */
709 if (!capable(CAP_NET_ADMIN))
710 return -EPERM;
711 mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]); 709 mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]);
712 return 0; 710 return 0;
713 } 711 }
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 9ef1c1bfa83d..8996b45ffffb 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -1204,8 +1204,6 @@ static int ei_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1204 data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f); 1204 data[3] = mdio_read(mii_addr, data[0], data[1] & 0x1f);
1205 return 0; 1205 return 0;
1206 case SIOCSMIIREG: /* Write MII PHY register. */ 1206 case SIOCSMIIREG: /* Write MII PHY register. */
1207 if (!capable(CAP_NET_ADMIN))
1208 return -EPERM;
1209 mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]); 1207 mdio_write(mii_addr, data[0], data[1] & 0x1f, data[2]);
1210 return 0; 1208 return 0;
1211 } 1209 }
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index 68de89167b49..9709dd173ddc 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -1575,8 +1575,6 @@ do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1575 data[3] = mii_rd(ioaddr, data[0] & 0x1f, data[1] & 0x1f); 1575 data[3] = mii_rd(ioaddr, data[0] & 0x1f, data[1] & 0x1f);
1576 break; 1576 break;
1577 case SIOCSMIIREG: /* Write the specified MII register */ 1577 case SIOCSMIIREG: /* Write the specified MII register */
1578 if (!capable(CAP_NET_ADMIN))
1579 return -EPERM;
1580 mii_wr(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2], 16); 1578 mii_wr(ioaddr, data[0] & 0x1f, data[1] & 0x1f, data[2], 16);
1581 break; 1579 break;
1582 default: 1580 default: