aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/x25_asy.c
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/wan/x25_asy.c
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/wan/x25_asy.c')
-rw-r--r--drivers/net/wan/x25_asy.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 3b7bdfd25148..85d789147300 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -64,7 +64,7 @@ static struct x25_asy *x25_asy_alloc(void)
64 if (dev == NULL) 64 if (dev == NULL)
65 break; 65 break;
66 66
67 sl = dev->priv; 67 sl = netdev_priv(dev);
68 /* Not in use ? */ 68 /* Not in use ? */
69 if (!test_and_set_bit(SLF_INUSE, &sl->flags)) 69 if (!test_and_set_bit(SLF_INUSE, &sl->flags))
70 return sl; 70 return sl;
@@ -86,7 +86,7 @@ static struct x25_asy *x25_asy_alloc(void)
86 return NULL; 86 return NULL;
87 87
88 /* Initialize channel control data */ 88 /* Initialize channel control data */
89 sl = dev->priv; 89 sl = netdev_priv(dev);
90 dev->base_addr = i; 90 dev->base_addr = i;
91 91
92 /* register device so that it can be ifconfig'ed */ 92 /* register device so that it can be ifconfig'ed */
@@ -120,7 +120,7 @@ static void x25_asy_free(struct x25_asy *sl)
120 120
121static int x25_asy_change_mtu(struct net_device *dev, int newmtu) 121static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
122{ 122{
123 struct x25_asy *sl = dev->priv; 123 struct x25_asy *sl = netdev_priv(dev);
124 unsigned char *xbuff, *rbuff; 124 unsigned char *xbuff, *rbuff;
125 int len = 2 * newmtu; 125 int len = 2 * newmtu;
126 126
@@ -279,7 +279,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
279 279
280static void x25_asy_timeout(struct net_device *dev) 280static void x25_asy_timeout(struct net_device *dev)
281{ 281{
282 struct x25_asy *sl = dev->priv; 282 struct x25_asy *sl = netdev_priv(dev);
283 283
284 spin_lock(&sl->lock); 284 spin_lock(&sl->lock);
285 if (netif_queue_stopped(dev)) { 285 if (netif_queue_stopped(dev)) {
@@ -300,7 +300,7 @@ static void x25_asy_timeout(struct net_device *dev)
300 300
301static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) 301static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev)
302{ 302{
303 struct x25_asy *sl = dev->priv; 303 struct x25_asy *sl = netdev_priv(dev);
304 int err; 304 int err;
305 305
306 if (!netif_running(sl->dev)) { 306 if (!netif_running(sl->dev)) {
@@ -371,7 +371,7 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
371 371
372static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) 372static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
373{ 373{
374 struct x25_asy *sl = dev->priv; 374 struct x25_asy *sl = netdev_priv(dev);
375 375
376 spin_lock(&sl->lock); 376 spin_lock(&sl->lock);
377 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { 377 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) {
@@ -396,7 +396,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
396 396
397static void x25_asy_connected(struct net_device *dev, int reason) 397static void x25_asy_connected(struct net_device *dev, int reason)
398{ 398{
399 struct x25_asy *sl = dev->priv; 399 struct x25_asy *sl = netdev_priv(dev);
400 struct sk_buff *skb; 400 struct sk_buff *skb;
401 unsigned char *ptr; 401 unsigned char *ptr;
402 402
@@ -415,7 +415,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
415 415
416static void x25_asy_disconnected(struct net_device *dev, int reason) 416static void x25_asy_disconnected(struct net_device *dev, int reason)
417{ 417{
418 struct x25_asy *sl = dev->priv; 418 struct x25_asy *sl = netdev_priv(dev);
419 struct sk_buff *skb; 419 struct sk_buff *skb;
420 unsigned char *ptr; 420 unsigned char *ptr;
421 421
@@ -446,7 +446,7 @@ static struct lapb_register_struct x25_asy_callbacks = {
446/* Open the low-level part of the X.25 channel. Easy! */ 446/* Open the low-level part of the X.25 channel. Easy! */
447static int x25_asy_open(struct net_device *dev) 447static int x25_asy_open(struct net_device *dev)
448{ 448{
449 struct x25_asy *sl = dev->priv; 449 struct x25_asy *sl = netdev_priv(dev);
450 unsigned long len; 450 unsigned long len;
451 int err; 451 int err;
452 452
@@ -495,7 +495,7 @@ norbuff:
495/* Close the low-level part of the X.25 channel. Easy! */ 495/* Close the low-level part of the X.25 channel. Easy! */
496static int x25_asy_close(struct net_device *dev) 496static int x25_asy_close(struct net_device *dev)
497{ 497{
498 struct x25_asy *sl = dev->priv; 498 struct x25_asy *sl = netdev_priv(dev);
499 int err; 499 int err;
500 500
501 spin_lock(&sl->lock); 501 spin_lock(&sl->lock);
@@ -611,7 +611,7 @@ static void x25_asy_close_tty(struct tty_struct *tty)
611 611
612static struct net_device_stats *x25_asy_get_stats(struct net_device *dev) 612static struct net_device_stats *x25_asy_get_stats(struct net_device *dev)
613{ 613{
614 struct x25_asy *sl = dev->priv; 614 struct x25_asy *sl = netdev_priv(dev);
615 return &sl->stats; 615 return &sl->stats;
616} 616}
617 617
@@ -713,7 +713,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
713 713
714static int x25_asy_open_dev(struct net_device *dev) 714static int x25_asy_open_dev(struct net_device *dev)
715{ 715{
716 struct x25_asy *sl = dev->priv; 716 struct x25_asy *sl = netdev_priv(dev);
717 if (sl->tty == NULL) 717 if (sl->tty == NULL)
718 return -ENODEV; 718 return -ENODEV;
719 return 0; 719 return 0;
@@ -722,7 +722,7 @@ static int x25_asy_open_dev(struct net_device *dev)
722/* Initialise the X.25 driver. Called by the device init code */ 722/* Initialise the X.25 driver. Called by the device init code */
723static void x25_asy_setup(struct net_device *dev) 723static void x25_asy_setup(struct net_device *dev)
724{ 724{
725 struct x25_asy *sl = dev->priv; 725 struct x25_asy *sl = netdev_priv(dev);
726 726
727 sl->magic = X25_ASY_MAGIC; 727 sl->magic = X25_ASY_MAGIC;
728 sl->dev = dev; 728 sl->dev = dev;
@@ -789,7 +789,7 @@ static void __exit exit_x25_asy(void)
789 for (i = 0; i < x25_asy_maxdev; i++) { 789 for (i = 0; i < x25_asy_maxdev; i++) {
790 dev = x25_asy_devs[i]; 790 dev = x25_asy_devs[i];
791 if (dev) { 791 if (dev) {
792 struct x25_asy *sl = dev->priv; 792 struct x25_asy *sl = netdev_priv(dev);
793 793
794 spin_lock_bh(&sl->lock); 794 spin_lock_bh(&sl->lock);
795 if (sl->tty) 795 if (sl->tty)