diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-11-13 02:37:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-13 02:37:49 -0500 |
commit | 454d7c9b14e20fd1949e2686e9de4a2926e01476 (patch) | |
tree | fae8bd1bfb5fd496977a0639ad71c54a2ee278ae /drivers/net/arcnet/com20020.c | |
parent | 7a12122c7a00347da9669cfcde82954c9e3d6f5e (diff) |
netdevice: safe convert to netdev_priv() #part-1
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/arcnet/com20020.c')
-rw-r--r-- | drivers/net/arcnet/com20020.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/arcnet/com20020.c b/drivers/net/arcnet/com20020.c index 70124a944e7d..103688358fb8 100644 --- a/drivers/net/arcnet/com20020.c +++ b/drivers/net/arcnet/com20020.c | |||
@@ -89,7 +89,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum, | |||
89 | int com20020_check(struct net_device *dev) | 89 | int com20020_check(struct net_device *dev) |
90 | { | 90 | { |
91 | int ioaddr = dev->base_addr, status; | 91 | int ioaddr = dev->base_addr, status; |
92 | struct arcnet_local *lp = dev->priv; | 92 | struct arcnet_local *lp = netdev_priv(dev); |
93 | 93 | ||
94 | ARCRESET0; | 94 | ARCRESET0; |
95 | mdelay(RESETtime); | 95 | mdelay(RESETtime); |
@@ -159,7 +159,7 @@ int com20020_found(struct net_device *dev, int shared) | |||
159 | 159 | ||
160 | /* Initialize the rest of the device structure. */ | 160 | /* Initialize the rest of the device structure. */ |
161 | 161 | ||
162 | lp = dev->priv; | 162 | lp = netdev_priv(dev); |
163 | 163 | ||
164 | lp->hw.owner = THIS_MODULE; | 164 | lp->hw.owner = THIS_MODULE; |
165 | lp->hw.command = com20020_command; | 165 | lp->hw.command = com20020_command; |
@@ -233,7 +233,7 @@ int com20020_found(struct net_device *dev, int shared) | |||
233 | */ | 233 | */ |
234 | static int com20020_reset(struct net_device *dev, int really_reset) | 234 | static int com20020_reset(struct net_device *dev, int really_reset) |
235 | { | 235 | { |
236 | struct arcnet_local *lp = dev->priv; | 236 | struct arcnet_local *lp = netdev_priv(dev); |
237 | u_int ioaddr = dev->base_addr; | 237 | u_int ioaddr = dev->base_addr; |
238 | u_char inbyte; | 238 | u_char inbyte; |
239 | 239 | ||
@@ -300,7 +300,7 @@ static int com20020_status(struct net_device *dev) | |||
300 | 300 | ||
301 | static void com20020_close(struct net_device *dev) | 301 | static void com20020_close(struct net_device *dev) |
302 | { | 302 | { |
303 | struct arcnet_local *lp = dev->priv; | 303 | struct arcnet_local *lp = netdev_priv(dev); |
304 | int ioaddr = dev->base_addr; | 304 | int ioaddr = dev->base_addr; |
305 | 305 | ||
306 | /* disable transmitter */ | 306 | /* disable transmitter */ |
@@ -317,7 +317,7 @@ static void com20020_close(struct net_device *dev) | |||
317 | */ | 317 | */ |
318 | static void com20020_set_mc_list(struct net_device *dev) | 318 | static void com20020_set_mc_list(struct net_device *dev) |
319 | { | 319 | { |
320 | struct arcnet_local *lp = dev->priv; | 320 | struct arcnet_local *lp = netdev_priv(dev); |
321 | int ioaddr = dev->base_addr; | 321 | int ioaddr = dev->base_addr; |
322 | 322 | ||
323 | if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ | 323 | if ((dev->flags & IFF_PROMISC) && (dev->flags & IFF_UP)) { /* Enable promiscuous mode */ |