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/arc-rimi.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/arc-rimi.c')
-rw-r--r-- | drivers/net/arcnet/arc-rimi.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/arcnet/arc-rimi.c b/drivers/net/arcnet/arc-rimi.c index 8c8d6c453c45..e3082a9350fc 100644 --- a/drivers/net/arcnet/arc-rimi.c +++ b/drivers/net/arcnet/arc-rimi.c | |||
@@ -194,7 +194,7 @@ static int __init arcrimi_found(struct net_device *dev) | |||
194 | 194 | ||
195 | /* initialize the rest of the device structure. */ | 195 | /* initialize the rest of the device structure. */ |
196 | 196 | ||
197 | lp = dev->priv; | 197 | lp = netdev_priv(dev); |
198 | lp->card_name = "RIM I"; | 198 | lp->card_name = "RIM I"; |
199 | lp->hw.command = arcrimi_command; | 199 | lp->hw.command = arcrimi_command; |
200 | lp->hw.status = arcrimi_status; | 200 | lp->hw.status = arcrimi_status; |
@@ -260,7 +260,7 @@ err_free_irq: | |||
260 | */ | 260 | */ |
261 | static int arcrimi_reset(struct net_device *dev, int really_reset) | 261 | static int arcrimi_reset(struct net_device *dev, int really_reset) |
262 | { | 262 | { |
263 | struct arcnet_local *lp = dev->priv; | 263 | struct arcnet_local *lp = netdev_priv(dev); |
264 | void __iomem *ioaddr = lp->mem_start + 0x800; | 264 | void __iomem *ioaddr = lp->mem_start + 0x800; |
265 | 265 | ||
266 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); | 266 | BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", dev->name, ASTATUS()); |
@@ -281,7 +281,7 @@ static int arcrimi_reset(struct net_device *dev, int really_reset) | |||
281 | 281 | ||
282 | static void arcrimi_setmask(struct net_device *dev, int mask) | 282 | static void arcrimi_setmask(struct net_device *dev, int mask) |
283 | { | 283 | { |
284 | struct arcnet_local *lp = dev->priv; | 284 | struct arcnet_local *lp = netdev_priv(dev); |
285 | void __iomem *ioaddr = lp->mem_start + 0x800; | 285 | void __iomem *ioaddr = lp->mem_start + 0x800; |
286 | 286 | ||
287 | AINTMASK(mask); | 287 | AINTMASK(mask); |
@@ -289,7 +289,7 @@ static void arcrimi_setmask(struct net_device *dev, int mask) | |||
289 | 289 | ||
290 | static int arcrimi_status(struct net_device *dev) | 290 | static int arcrimi_status(struct net_device *dev) |
291 | { | 291 | { |
292 | struct arcnet_local *lp = dev->priv; | 292 | struct arcnet_local *lp = netdev_priv(dev); |
293 | void __iomem *ioaddr = lp->mem_start + 0x800; | 293 | void __iomem *ioaddr = lp->mem_start + 0x800; |
294 | 294 | ||
295 | return ASTATUS(); | 295 | return ASTATUS(); |
@@ -297,7 +297,7 @@ static int arcrimi_status(struct net_device *dev) | |||
297 | 297 | ||
298 | static void arcrimi_command(struct net_device *dev, int cmd) | 298 | static void arcrimi_command(struct net_device *dev, int cmd) |
299 | { | 299 | { |
300 | struct arcnet_local *lp = dev->priv; | 300 | struct arcnet_local *lp = netdev_priv(dev); |
301 | void __iomem *ioaddr = lp->mem_start + 0x800; | 301 | void __iomem *ioaddr = lp->mem_start + 0x800; |
302 | 302 | ||
303 | ACOMMAND(cmd); | 303 | ACOMMAND(cmd); |
@@ -306,7 +306,7 @@ static void arcrimi_command(struct net_device *dev, int cmd) | |||
306 | static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, | 306 | static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, |
307 | void *buf, int count) | 307 | void *buf, int count) |
308 | { | 308 | { |
309 | struct arcnet_local *lp = dev->priv; | 309 | struct arcnet_local *lp = netdev_priv(dev); |
310 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; | 310 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; |
311 | TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); | 311 | TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count)); |
312 | } | 312 | } |
@@ -315,7 +315,7 @@ static void arcrimi_copy_to_card(struct net_device *dev, int bufnum, int offset, | |||
315 | static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, | 315 | static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset, |
316 | void *buf, int count) | 316 | void *buf, int count) |
317 | { | 317 | { |
318 | struct arcnet_local *lp = dev->priv; | 318 | struct arcnet_local *lp = netdev_priv(dev); |
319 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; | 319 | void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset; |
320 | TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); | 320 | TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count)); |
321 | } | 321 | } |
@@ -361,7 +361,7 @@ static int __init arc_rimi_init(void) | |||
361 | static void __exit arc_rimi_exit(void) | 361 | static void __exit arc_rimi_exit(void) |
362 | { | 362 | { |
363 | struct net_device *dev = my_dev; | 363 | struct net_device *dev = my_dev; |
364 | struct arcnet_local *lp = dev->priv; | 364 | struct arcnet_local *lp = netdev_priv(dev); |
365 | 365 | ||
366 | unregister_netdev(dev); | 366 | unregister_netdev(dev); |
367 | iounmap(lp->mem_start); | 367 | iounmap(lp->mem_start); |