aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda/sir_dev.c
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:14 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:14 -0500
commit4cf1653aa90c6320dc8032443b5e322820aa28b1 (patch)
tree7920008d3f953defdcda8c81d39da963290d93ad /drivers/net/irda/sir_dev.c
parent454d7c9b14e20fd1949e2686e9de4a2926e01476 (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/irda/sir_dev.c')
-rw-r--r--drivers/net/irda/sir_dev.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c
index 3f32909c24c8..ceef040aa76d 100644
--- a/drivers/net/irda/sir_dev.c
+++ b/drivers/net/irda/sir_dev.c
@@ -584,14 +584,14 @@ EXPORT_SYMBOL(sirdev_receive);
584 584
585static struct net_device_stats *sirdev_get_stats(struct net_device *ndev) 585static struct net_device_stats *sirdev_get_stats(struct net_device *ndev)
586{ 586{
587 struct sir_dev *dev = ndev->priv; 587 struct sir_dev *dev = netdev_priv(ndev);
588 588
589 return (dev) ? &dev->stats : NULL; 589 return (dev) ? &dev->stats : NULL;
590} 590}
591 591
592static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev) 592static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
593{ 593{
594 struct sir_dev *dev = ndev->priv; 594 struct sir_dev *dev = netdev_priv(ndev);
595 unsigned long flags; 595 unsigned long flags;
596 int actual = 0; 596 int actual = 0;
597 int err; 597 int err;
@@ -683,7 +683,7 @@ static int sirdev_hard_xmit(struct sk_buff *skb, struct net_device *ndev)
683static int sirdev_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd) 683static int sirdev_ioctl(struct net_device *ndev, struct ifreq *rq, int cmd)
684{ 684{
685 struct if_irda_req *irq = (struct if_irda_req *) rq; 685 struct if_irda_req *irq = (struct if_irda_req *) rq;
686 struct sir_dev *dev = ndev->priv; 686 struct sir_dev *dev = netdev_priv(ndev);
687 int ret = 0; 687 int ret = 0;
688 688
689 IRDA_ASSERT(dev != NULL, return -1;); 689 IRDA_ASSERT(dev != NULL, return -1;);
@@ -795,7 +795,7 @@ static void sirdev_free_buffers(struct sir_dev *dev)
795 795
796static int sirdev_open(struct net_device *ndev) 796static int sirdev_open(struct net_device *ndev)
797{ 797{
798 struct sir_dev *dev = ndev->priv; 798 struct sir_dev *dev = netdev_priv(ndev);
799 const struct sir_driver *drv = dev->drv; 799 const struct sir_driver *drv = dev->drv;
800 800
801 if (!drv) 801 if (!drv)
@@ -840,7 +840,7 @@ errout_dec:
840 840
841static int sirdev_close(struct net_device *ndev) 841static int sirdev_close(struct net_device *ndev)
842{ 842{
843 struct sir_dev *dev = ndev->priv; 843 struct sir_dev *dev = netdev_priv(ndev);
844 const struct sir_driver *drv; 844 const struct sir_driver *drv;
845 845
846// IRDA_DEBUG(0, "%s\n", __func__); 846// IRDA_DEBUG(0, "%s\n", __func__);
@@ -896,7 +896,7 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n
896 IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__); 896 IRDA_ERROR("%s - Can't allocate memory for IrDA control block!\n", __func__);
897 goto out; 897 goto out;
898 } 898 }
899 dev = ndev->priv; 899 dev = netdev_priv(ndev);
900 900
901 irda_init_max_qos_capabilies(&dev->qos); 901 irda_init_max_qos_capabilies(&dev->qos);
902 dev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200; 902 dev->qos.baud_rate.bits = IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;