diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:38:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:38:14 -0500 |
commit | 4cf1653aa90c6320dc8032443b5e322820aa28b1 (patch) | |
tree | 7920008d3f953defdcda8c81d39da963290d93ad /drivers/net/irda/nsc-ircc.c | |
parent | 454d7c9b14e20fd1949e2686e9de4a2926e01476 (diff) |
netdevice: safe convert to netdev_priv() #part-2
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/irda/nsc-ircc.c')
-rw-r--r-- | drivers/net/irda/nsc-ircc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c index 4e1bc08971a8..2c6bf2d11bb1 100644 --- a/drivers/net/irda/nsc-ircc.c +++ b/drivers/net/irda/nsc-ircc.c | |||
@@ -373,7 +373,7 @@ static int __init nsc_ircc_open(chipio_t *info) | |||
373 | return -ENOMEM; | 373 | return -ENOMEM; |
374 | } | 374 | } |
375 | 375 | ||
376 | self = dev->priv; | 376 | self = netdev_priv(dev); |
377 | self->netdev = dev; | 377 | self->netdev = dev; |
378 | spin_lock_init(&self->lock); | 378 | spin_lock_init(&self->lock); |
379 | 379 | ||
@@ -1354,7 +1354,7 @@ static int nsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev) | |||
1354 | __s32 speed; | 1354 | __s32 speed; |
1355 | __u8 bank; | 1355 | __u8 bank; |
1356 | 1356 | ||
1357 | self = (struct nsc_ircc_cb *) dev->priv; | 1357 | self = netdev_priv(dev); |
1358 | 1358 | ||
1359 | IRDA_ASSERT(self != NULL, return 0;); | 1359 | IRDA_ASSERT(self != NULL, return 0;); |
1360 | 1360 | ||
@@ -1427,7 +1427,7 @@ static int nsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | |||
1427 | __u8 bank; | 1427 | __u8 bank; |
1428 | int mtt, diff; | 1428 | int mtt, diff; |
1429 | 1429 | ||
1430 | self = (struct nsc_ircc_cb *) dev->priv; | 1430 | self = netdev_priv(dev); |
1431 | iobase = self->io.fir_base; | 1431 | iobase = self->io.fir_base; |
1432 | 1432 | ||
1433 | netif_stop_queue(dev); | 1433 | netif_stop_queue(dev); |
@@ -2084,7 +2084,7 @@ static irqreturn_t nsc_ircc_interrupt(int irq, void *dev_id) | |||
2084 | __u8 bsr, eir; | 2084 | __u8 bsr, eir; |
2085 | int iobase; | 2085 | int iobase; |
2086 | 2086 | ||
2087 | self = dev->priv; | 2087 | self = netdev_priv(dev); |
2088 | 2088 | ||
2089 | spin_lock(&self->lock); | 2089 | spin_lock(&self->lock); |
2090 | 2090 | ||
@@ -2165,7 +2165,7 @@ static int nsc_ircc_net_open(struct net_device *dev) | |||
2165 | IRDA_DEBUG(4, "%s()\n", __func__); | 2165 | IRDA_DEBUG(4, "%s()\n", __func__); |
2166 | 2166 | ||
2167 | IRDA_ASSERT(dev != NULL, return -1;); | 2167 | IRDA_ASSERT(dev != NULL, return -1;); |
2168 | self = (struct nsc_ircc_cb *) dev->priv; | 2168 | self = netdev_priv(dev); |
2169 | 2169 | ||
2170 | IRDA_ASSERT(self != NULL, return 0;); | 2170 | IRDA_ASSERT(self != NULL, return 0;); |
2171 | 2171 | ||
@@ -2228,7 +2228,7 @@ static int nsc_ircc_net_close(struct net_device *dev) | |||
2228 | 2228 | ||
2229 | IRDA_ASSERT(dev != NULL, return -1;); | 2229 | IRDA_ASSERT(dev != NULL, return -1;); |
2230 | 2230 | ||
2231 | self = (struct nsc_ircc_cb *) dev->priv; | 2231 | self = netdev_priv(dev); |
2232 | IRDA_ASSERT(self != NULL, return 0;); | 2232 | IRDA_ASSERT(self != NULL, return 0;); |
2233 | 2233 | ||
2234 | /* Stop device */ | 2234 | /* Stop device */ |
@@ -2274,7 +2274,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2274 | 2274 | ||
2275 | IRDA_ASSERT(dev != NULL, return -1;); | 2275 | IRDA_ASSERT(dev != NULL, return -1;); |
2276 | 2276 | ||
2277 | self = dev->priv; | 2277 | self = netdev_priv(dev); |
2278 | 2278 | ||
2279 | IRDA_ASSERT(self != NULL, return -1;); | 2279 | IRDA_ASSERT(self != NULL, return -1;); |
2280 | 2280 | ||
@@ -2309,7 +2309,7 @@ static int nsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
2309 | 2309 | ||
2310 | static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev) | 2310 | static struct net_device_stats *nsc_ircc_net_get_stats(struct net_device *dev) |
2311 | { | 2311 | { |
2312 | struct nsc_ircc_cb *self = (struct nsc_ircc_cb *) dev->priv; | 2312 | struct nsc_ircc_cb *self = netdev_priv(dev); |
2313 | 2313 | ||
2314 | return &self->stats; | 2314 | return &self->stats; |
2315 | } | 2315 | } |