aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tokenring
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:36 -0500
commit8f15ea42b64941001a401cf855a0869e24f3a845 (patch)
tree27c7534ad70ebda6986491daeac0ebe0f1ca54ed /drivers/net/tokenring
parent4cf1653aa90c6320dc8032443b5e322820aa28b1 (diff)
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 <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tokenring')
-rw-r--r--drivers/net/tokenring/tms380tr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/tokenring/tms380tr.c b/drivers/net/tokenring/tms380tr.c
index b408397c83e7..5be34c2fd483 100644
--- a/drivers/net/tokenring/tms380tr.c
+++ b/drivers/net/tokenring/tms380tr.c
@@ -180,10 +180,14 @@ void tms380tr_wait(unsigned long time);
180static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status); 180static void tms380tr_write_rpl_status(RPL *rpl, unsigned int Status);
181static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status); 181static void tms380tr_write_tpl_status(TPL *tpl, unsigned int Status);
182 182
183#define SIFREADB(reg) (((struct net_local *)dev->priv)->sifreadb(dev, reg)) 183#define SIFREADB(reg) \
184#define SIFWRITEB(val, reg) (((struct net_local *)dev->priv)->sifwriteb(dev, val, reg)) 184 (((struct net_local *)netdev_priv(dev))->sifreadb(dev, reg))
185#define SIFREADW(reg) (((struct net_local *)dev->priv)->sifreadw(dev, reg)) 185#define SIFWRITEB(val, reg) \
186#define SIFWRITEW(val, reg) (((struct net_local *)dev->priv)->sifwritew(dev, val, reg)) 186 (((struct net_local *)netdev_priv(dev))->sifwriteb(dev, val, reg))
187#define SIFREADW(reg) \
188 (((struct net_local *)netdev_priv(dev))->sifreadw(dev, reg))
189#define SIFWRITEW(val, reg) \
190 (((struct net_local *)netdev_priv(dev))->sifwritew(dev, val, reg))
187 191
188 192
189 193
@@ -2330,7 +2334,7 @@ int tmsdev_init(struct net_device *dev, struct device *pdev)
2330{ 2334{
2331 struct net_local *tms_local; 2335 struct net_local *tms_local;
2332 2336
2333 memset(dev->priv, 0, sizeof(struct net_local)); 2337 memset(netdev_priv(dev), 0, sizeof(struct net_local));
2334 tms_local = netdev_priv(dev); 2338 tms_local = netdev_priv(dev);
2335 init_waitqueue_head(&tms_local->wait_for_tok_int); 2339 init_waitqueue_head(&tms_local->wait_for_tok_int);
2336 if (pdev->dma_mask) 2340 if (pdev->dma_mask)