aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sunbmac.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:36 -0500
commit8f15ea42b64941001a401cf855a0869e24f3a845 (patch)
tree27c7534ad70ebda6986491daeac0ebe0f1ca54ed /drivers/net/sunbmac.c
parent4cf1653aa90c6320dc8032443b5e322820aa28b1 (diff)
netdevice: safe convert to netdev_priv() #part-3
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sunbmac.c')
-rw-r--r--drivers/net/sunbmac.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 3f57ba0ed03a..977b3e08bbfc 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -916,7 +916,7 @@ static irqreturn_t bigmac_interrupt(int irq, void *dev_id)
916 916
917static int bigmac_open(struct net_device *dev) 917static int bigmac_open(struct net_device *dev)
918{ 918{
919 struct bigmac *bp = (struct bigmac *) dev->priv; 919 struct bigmac *bp = netdev_priv(dev);
920 int ret; 920 int ret;
921 921
922 ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp); 922 ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp);
@@ -933,7 +933,7 @@ static int bigmac_open(struct net_device *dev)
933 933
934static int bigmac_close(struct net_device *dev) 934static int bigmac_close(struct net_device *dev)
935{ 935{
936 struct bigmac *bp = (struct bigmac *) dev->priv; 936 struct bigmac *bp = netdev_priv(dev);
937 937
938 del_timer(&bp->bigmac_timer); 938 del_timer(&bp->bigmac_timer);
939 bp->timer_state = asleep; 939 bp->timer_state = asleep;
@@ -947,7 +947,7 @@ static int bigmac_close(struct net_device *dev)
947 947
948static void bigmac_tx_timeout(struct net_device *dev) 948static void bigmac_tx_timeout(struct net_device *dev)
949{ 949{
950 struct bigmac *bp = (struct bigmac *) dev->priv; 950 struct bigmac *bp = netdev_priv(dev);
951 951
952 bigmac_init_hw(bp, 0); 952 bigmac_init_hw(bp, 0);
953 netif_wake_queue(dev); 953 netif_wake_queue(dev);
@@ -956,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev)
956/* Put a packet on the wire. */ 956/* Put a packet on the wire. */
957static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev) 957static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
958{ 958{
959 struct bigmac *bp = (struct bigmac *) dev->priv; 959 struct bigmac *bp = netdev_priv(dev);
960 int len, entry; 960 int len, entry;
961 u32 mapping; 961 u32 mapping;
962 962
@@ -989,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
989 989
990static struct net_device_stats *bigmac_get_stats(struct net_device *dev) 990static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
991{ 991{
992 struct bigmac *bp = (struct bigmac *) dev->priv; 992 struct bigmac *bp = netdev_priv(dev);
993 993
994 bigmac_get_counters(bp, bp->bregs); 994 bigmac_get_counters(bp, bp->bregs);
995 return &bp->enet_stats; 995 return &bp->enet_stats;
@@ -997,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev)
997 997
998static void bigmac_set_multicast(struct net_device *dev) 998static void bigmac_set_multicast(struct net_device *dev)
999{ 999{
1000 struct bigmac *bp = (struct bigmac *) dev->priv; 1000 struct bigmac *bp = netdev_priv(dev);
1001 void __iomem *bregs = bp->bregs; 1001 void __iomem *bregs = bp->bregs;
1002 struct dev_mc_list *dmi = dev->mc_list; 1002 struct dev_mc_list *dmi = dev->mc_list;
1003 char *addrs; 1003 char *addrs;
@@ -1060,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i
1060 1060
1061static u32 bigmac_get_link(struct net_device *dev) 1061static u32 bigmac_get_link(struct net_device *dev)
1062{ 1062{
1063 struct bigmac *bp = dev->priv; 1063 struct bigmac *bp = netdev_priv(dev);
1064 1064
1065 spin_lock_irq(&bp->lock); 1065 spin_lock_irq(&bp->lock);
1066 bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR); 1066 bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR);