From 8f15ea42b64941001a401cf855a0869e24f3a845 Mon Sep 17 00:00:00 2001 From: Wang Chen Date: Wed, 12 Nov 2008 23:38:36 -0800 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/sunbmac.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/net/sunbmac.c') 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) static int bigmac_open(struct net_device *dev) { - struct bigmac *bp = (struct bigmac *) dev->priv; + struct bigmac *bp = netdev_priv(dev); int ret; ret = request_irq(dev->irq, &bigmac_interrupt, IRQF_SHARED, dev->name, bp); @@ -933,7 +933,7 @@ static int bigmac_open(struct net_device *dev) static int bigmac_close(struct net_device *dev) { - struct bigmac *bp = (struct bigmac *) dev->priv; + struct bigmac *bp = netdev_priv(dev); del_timer(&bp->bigmac_timer); bp->timer_state = asleep; @@ -947,7 +947,7 @@ static int bigmac_close(struct net_device *dev) static void bigmac_tx_timeout(struct net_device *dev) { - struct bigmac *bp = (struct bigmac *) dev->priv; + struct bigmac *bp = netdev_priv(dev); bigmac_init_hw(bp, 0); netif_wake_queue(dev); @@ -956,7 +956,7 @@ static void bigmac_tx_timeout(struct net_device *dev) /* Put a packet on the wire. */ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev) { - struct bigmac *bp = (struct bigmac *) dev->priv; + struct bigmac *bp = netdev_priv(dev); int len, entry; u32 mapping; @@ -989,7 +989,7 @@ static int bigmac_start_xmit(struct sk_buff *skb, struct net_device *dev) static struct net_device_stats *bigmac_get_stats(struct net_device *dev) { - struct bigmac *bp = (struct bigmac *) dev->priv; + struct bigmac *bp = netdev_priv(dev); bigmac_get_counters(bp, bp->bregs); return &bp->enet_stats; @@ -997,7 +997,7 @@ static struct net_device_stats *bigmac_get_stats(struct net_device *dev) static void bigmac_set_multicast(struct net_device *dev) { - struct bigmac *bp = (struct bigmac *) dev->priv; + struct bigmac *bp = netdev_priv(dev); void __iomem *bregs = bp->bregs; struct dev_mc_list *dmi = dev->mc_list; char *addrs; @@ -1060,7 +1060,7 @@ static void bigmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i static u32 bigmac_get_link(struct net_device *dev) { - struct bigmac *bp = dev->priv; + struct bigmac *bp = netdev_priv(dev); spin_lock_irq(&bp->lock); bp->sw_bmsr = bigmac_tcvr_read(bp, bp->tregs, BIGMAC_BMSR); -- cgit v1.2.1