diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2005-09-06 18:19:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-07 19:57:58 -0400 |
commit | da0841a09531818000f816b76374abaef7e4b9b9 (patch) | |
tree | 1ebc57def95299b794736ba8cc8a0800c3164e8c /drivers/net/irda/smsc-ircc2.c | |
parent | 6bb3b2cd40973ca67c9c6ab26c34df61680f5f84 (diff) |
[PATCH] smsc-ircc2: use netdev_priv()
IRDA: smsc-ircc2 - use netdev_priv() instead of accessing pointer
directly.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Cc: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net/irda/smsc-ircc2.c')
-rw-r--r-- | drivers/net/irda/smsc-ircc2.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 0f651eeb24ca..236501f0c5a6 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -426,7 +426,7 @@ static int __init smsc_ircc_open(unsigned int fir_base, unsigned int sir_base, u | |||
426 | dev->do_ioctl = smsc_ircc_net_ioctl; | 426 | dev->do_ioctl = smsc_ircc_net_ioctl; |
427 | dev->get_stats = smsc_ircc_net_get_stats; | 427 | dev->get_stats = smsc_ircc_net_get_stats; |
428 | 428 | ||
429 | self = dev->priv; | 429 | self = netdev_priv(dev); |
430 | self->netdev = dev; | 430 | self->netdev = dev; |
431 | 431 | ||
432 | /* Make ifconfig display some details */ | 432 | /* Make ifconfig display some details */ |
@@ -691,7 +691,7 @@ static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd | |||
691 | 691 | ||
692 | IRDA_ASSERT(dev != NULL, return -1;); | 692 | IRDA_ASSERT(dev != NULL, return -1;); |
693 | 693 | ||
694 | self = dev->priv; | 694 | self = netdev_priv(dev); |
695 | 695 | ||
696 | IRDA_ASSERT(self != NULL, return -1;); | 696 | IRDA_ASSERT(self != NULL, return -1;); |
697 | 697 | ||
@@ -738,7 +738,7 @@ static int smsc_ircc_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd | |||
738 | 738 | ||
739 | static struct net_device_stats *smsc_ircc_net_get_stats(struct net_device *dev) | 739 | static struct net_device_stats *smsc_ircc_net_get_stats(struct net_device *dev) |
740 | { | 740 | { |
741 | struct smsc_ircc_cb *self = (struct smsc_ircc_cb *) dev->priv; | 741 | struct smsc_ircc_cb *self = netdev_priv(dev); |
742 | 742 | ||
743 | return &self->stats; | 743 | return &self->stats; |
744 | } | 744 | } |
@@ -753,11 +753,9 @@ static struct net_device_stats *smsc_ircc_net_get_stats(struct net_device *dev) | |||
753 | 753 | ||
754 | static void smsc_ircc_timeout(struct net_device *dev) | 754 | static void smsc_ircc_timeout(struct net_device *dev) |
755 | { | 755 | { |
756 | struct smsc_ircc_cb *self; | 756 | struct smsc_ircc_cb *self = netdev_priv(dev); |
757 | unsigned long flags; | 757 | unsigned long flags; |
758 | 758 | ||
759 | self = (struct smsc_ircc_cb *) dev->priv; | ||
760 | |||
761 | IRDA_WARNING("%s: transmit timed out, changing speed to: %d\n", | 759 | IRDA_WARNING("%s: transmit timed out, changing speed to: %d\n", |
762 | dev->name, self->io.speed); | 760 | dev->name, self->io.speed); |
763 | spin_lock_irqsave(&self->lock, flags); | 761 | spin_lock_irqsave(&self->lock, flags); |
@@ -786,7 +784,7 @@ int smsc_ircc_hard_xmit_sir(struct sk_buff *skb, struct net_device *dev) | |||
786 | 784 | ||
787 | IRDA_ASSERT(dev != NULL, return 0;); | 785 | IRDA_ASSERT(dev != NULL, return 0;); |
788 | 786 | ||
789 | self = (struct smsc_ircc_cb *) dev->priv; | 787 | self = netdev_priv(dev); |
790 | IRDA_ASSERT(self != NULL, return 0;); | 788 | IRDA_ASSERT(self != NULL, return 0;); |
791 | 789 | ||
792 | netif_stop_queue(dev); | 790 | netif_stop_queue(dev); |
@@ -1094,7 +1092,7 @@ static int smsc_ircc_hard_xmit_fir(struct sk_buff *skb, struct net_device *dev) | |||
1094 | int mtt; | 1092 | int mtt; |
1095 | 1093 | ||
1096 | IRDA_ASSERT(dev != NULL, return 0;); | 1094 | IRDA_ASSERT(dev != NULL, return 0;); |
1097 | self = (struct smsc_ircc_cb *) dev->priv; | 1095 | self = netdev_priv(dev); |
1098 | IRDA_ASSERT(self != NULL, return 0;); | 1096 | IRDA_ASSERT(self != NULL, return 0;); |
1099 | 1097 | ||
1100 | netif_stop_queue(dev); | 1098 | netif_stop_queue(dev); |
@@ -1425,7 +1423,8 @@ static irqreturn_t smsc_ircc_interrupt(int irq, void *dev_id, struct pt_regs *re | |||
1425 | driver_name, irq); | 1423 | driver_name, irq); |
1426 | goto irq_ret; | 1424 | goto irq_ret; |
1427 | } | 1425 | } |
1428 | self = (struct smsc_ircc_cb *) dev->priv; | 1426 | |
1427 | self = netdev_priv(dev); | ||
1429 | IRDA_ASSERT(self != NULL, return IRQ_NONE;); | 1428 | IRDA_ASSERT(self != NULL, return IRQ_NONE;); |
1430 | 1429 | ||
1431 | /* Serialise the interrupt handler in various CPUs, stop Tx path */ | 1430 | /* Serialise the interrupt handler in various CPUs, stop Tx path */ |
@@ -1483,7 +1482,7 @@ static irqreturn_t smsc_ircc_interrupt(int irq, void *dev_id, struct pt_regs *re | |||
1483 | */ | 1482 | */ |
1484 | static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev) | 1483 | static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev) |
1485 | { | 1484 | { |
1486 | struct smsc_ircc_cb *self = dev->priv; | 1485 | struct smsc_ircc_cb *self = netdev_priv(dev); |
1487 | int boguscount = 0; | 1486 | int boguscount = 0; |
1488 | int iobase; | 1487 | int iobase; |
1489 | int iir, lsr; | 1488 | int iir, lsr; |
@@ -1574,7 +1573,7 @@ static int smsc_ircc_net_open(struct net_device *dev) | |||
1574 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1573 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); |
1575 | 1574 | ||
1576 | IRDA_ASSERT(dev != NULL, return -1;); | 1575 | IRDA_ASSERT(dev != NULL, return -1;); |
1577 | self = (struct smsc_ircc_cb *) dev->priv; | 1576 | self = netdev_priv(dev); |
1578 | IRDA_ASSERT(self != NULL, return 0;); | 1577 | IRDA_ASSERT(self != NULL, return 0;); |
1579 | 1578 | ||
1580 | if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, | 1579 | if (request_irq(self->io.irq, smsc_ircc_interrupt, 0, dev->name, |
@@ -1630,7 +1629,7 @@ static int smsc_ircc_net_close(struct net_device *dev) | |||
1630 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); | 1629 | IRDA_DEBUG(1, "%s\n", __FUNCTION__); |
1631 | 1630 | ||
1632 | IRDA_ASSERT(dev != NULL, return -1;); | 1631 | IRDA_ASSERT(dev != NULL, return -1;); |
1633 | self = (struct smsc_ircc_cb *) dev->priv; | 1632 | self = netdev_priv(dev); |
1634 | IRDA_ASSERT(self != NULL, return 0;); | 1633 | IRDA_ASSERT(self != NULL, return 0;); |
1635 | 1634 | ||
1636 | /* Stop device */ | 1635 | /* Stop device */ |