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/mvme147.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/mvme147.c')
-rw-r--r-- | drivers/net/mvme147.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/mvme147.c b/drivers/net/mvme147.c index d30b0d0026ec..435e5a847c43 100644 --- a/drivers/net/mvme147.c +++ b/drivers/net/mvme147.c | |||
@@ -105,7 +105,7 @@ struct net_device * __init mvme147lance_probe(int unit) | |||
105 | dev->name, dev->base_addr, MVME147_LANCE_IRQ, | 105 | dev->name, dev->base_addr, MVME147_LANCE_IRQ, |
106 | dev->dev_addr); | 106 | dev->dev_addr); |
107 | 107 | ||
108 | lp = (struct m147lance_private *)dev->priv; | 108 | lp = netdev_priv(dev); |
109 | lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */ | 109 | lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */ |
110 | if (!lp->ram) | 110 | if (!lp->ram) |
111 | { | 111 | { |
@@ -189,7 +189,7 @@ int __init init_module(void) | |||
189 | 189 | ||
190 | void __exit cleanup_module(void) | 190 | void __exit cleanup_module(void) |
191 | { | 191 | { |
192 | struct m147lance_private *lp = dev_mvme147_lance->priv; | 192 | struct m147lance_private *lp = netdev_priv(dev_mvme147_lance); |
193 | unregister_netdev(dev_mvme147_lance); | 193 | unregister_netdev(dev_mvme147_lance); |
194 | free_pages(lp->ram, 3); | 194 | free_pages(lp->ram, 3); |
195 | free_netdev(dev_mvme147_lance); | 195 | free_netdev(dev_mvme147_lance); |