Skip to contentSkip to conversation

Use netdev_priv in baycom_ser_fdx driver

PATCH Applied Ralf Baechle DL5RB 1 participant 1 message Jan 30, 2005 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 8/9 Use netdev_priv in baycom_ser_fdx driver

Eleminate the last remaining instance of a direct reference to the priv member of struct net_device. This was debug code only, so use BUG_ON() instead of printk.

 baycom_ser_fdx.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/hamradio/baycom_ser_fdx.c +3 -4
Index: bk-afu/drivers/net/hamradio/baycom_ser_fdx.c
===================================================================
@@ -530,12 +530,11 @@
 	struct baycom_state *bc;
 	struct baycom_ioctl bi;
 
-	if (!dev || !dev->priv ||
-	    ((struct baycom_state *)dev->priv)->hdrv.magic != HDLCDRV_MAGIC) {
-		printk(KERN_ERR "bc_ioctl: invalid device struct\n");
+	if (!dev)
 		return -EINVAL;
-	}
+
 	bc = netdev_priv(dev);
+	BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);
 
 	if (cmd != SIOCDEVPRIVATE)
 		return -ENOIOCTLCMD;