[patch 8/9] smsc-ircc2: use netdev_priv()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



IRDA: smsc-ircc2 - use netdev_priv() instead of accessing pointer
      directly.

Signed-off-by: Dmitry Torokhov <[email protected]>
---

 smsc-ircc2.c |   23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

Index: dtor/drivers/net/irda/smsc-ircc2.c
===================================================================
--- dtor.orig/drivers/net/irda/smsc-ircc2.c
+++ dtor/drivers/net/irda/smsc-ircc2.c
@@ -426,7 +426,7 @@ static int __init smsc_ircc_open(unsigne
 	dev->do_ioctl        = smsc_ircc_net_ioctl;
 	dev->get_stats	     = smsc_ircc_net_get_stats;
 
-	self = dev->priv;
+	self = netdev_priv(dev);
 	self->netdev = dev;
 
 	/* Make ifconfig display some details */
@@ -693,7 +693,7 @@ static int smsc_ircc_net_ioctl(struct ne
 
 	IRDA_ASSERT(dev != NULL, return -1;);
 
-	self = dev->priv;
+	self = netdev_priv(dev);
 
 	IRDA_ASSERT(self != NULL, return -1;);
 
@@ -740,7 +740,7 @@ static int smsc_ircc_net_ioctl(struct ne
 
 static struct net_device_stats *smsc_ircc_net_get_stats(struct net_device *dev)
 {
-	struct smsc_ircc_cb *self = (struct smsc_ircc_cb *) dev->priv;
+	struct smsc_ircc_cb *self = netdev_priv(dev);
 
 	return &self->stats;
 }
@@ -755,11 +755,9 @@ static struct net_device_stats *smsc_irc
 
 static void smsc_ircc_timeout(struct net_device *dev)
 {
-	struct smsc_ircc_cb *self;
+	struct smsc_ircc_cb *self = netdev_priv(dev);
 	unsigned long flags;
 
-	self = (struct smsc_ircc_cb *) dev->priv;
-
 	IRDA_WARNING("%s: transmit timed out, changing speed to: %d\n",
 		     dev->name, self->io.speed);
 	spin_lock_irqsave(&self->lock, flags);
@@ -788,7 +786,7 @@ int smsc_ircc_hard_xmit_sir(struct sk_bu
 
 	IRDA_ASSERT(dev != NULL, return 0;);
 
-	self = (struct smsc_ircc_cb *) dev->priv;
+	self = netdev_priv(dev);
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	netif_stop_queue(dev);
@@ -1096,7 +1094,7 @@ static int smsc_ircc_hard_xmit_fir(struc
 	int mtt;
 
 	IRDA_ASSERT(dev != NULL, return 0;);
-	self = (struct smsc_ircc_cb *) dev->priv;
+	self = netdev_priv(dev);
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	netif_stop_queue(dev);
@@ -1427,7 +1425,8 @@ static irqreturn_t smsc_ircc_interrupt(i
 		       driver_name, irq);
 		goto irq_ret;
 	}
-	self = (struct smsc_ircc_cb *) dev->priv;
+
+	self = netdev_priv(dev);
 	IRDA_ASSERT(self != NULL, return IRQ_NONE;);
 
 	/* Serialise the interrupt handler in various CPUs, stop Tx path */
@@ -1485,7 +1484,7 @@ static irqreturn_t smsc_ircc_interrupt(i
  */
 static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev)
 {
-	struct smsc_ircc_cb *self = dev->priv;
+	struct smsc_ircc_cb *self = netdev_priv(dev);
 	int boguscount = 0;
 	int iobase;
 	int iir, lsr;
@@ -1576,7 +1575,7 @@ static int smsc_ircc_net_open(struct net
 	IRDA_DEBUG(1, "%s\n", __FUNCTION__);
 
 	IRDA_ASSERT(dev != NULL, return -1;);
-	self = (struct smsc_ircc_cb *) dev->priv;
+	self = netdev_priv(dev);
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	if (self->io.suspended) {
@@ -1637,7 +1636,7 @@ static int smsc_ircc_net_close(struct ne
 	IRDA_DEBUG(1, "%s\n", __FUNCTION__);
 
 	IRDA_ASSERT(dev != NULL, return -1;);
-	self = (struct smsc_ircc_cb *) dev->priv;
+	self = netdev_priv(dev);
 	IRDA_ASSERT(self != NULL, return 0;);
 
 	/* Stop device */

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux