fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / hamradio / baycom_par.c
index eb9a680..5930aeb 100644 (file)
@@ -84,6 +84,7 @@
 #include <linux/baycom.h>
 #include <linux/parport.h>
 #include <linux/bitops.h>
+#include <linux/jiffies.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -164,7 +165,7 @@ static void __inline__ baycom_int_freq(struct baycom_state *bc)
         * measure the interrupt frequency
         */
        bc->debug_vals.cur_intcnt++;
-       if ((cur_jiffies - bc->debug_vals.last_jiffies) >= HZ) {
+       if (time_after_eq(cur_jiffies, bc->debug_vals.last_jiffies + HZ)) {
                bc->debug_vals.last_jiffies = cur_jiffies;
                bc->debug_vals.last_intcnt = bc->debug_vals.cur_intcnt;
                bc->debug_vals.cur_intcnt = 0;
@@ -269,7 +270,7 @@ static __inline__ void par96_rx(struct net_device *dev, struct baycom_state *bc)
 
 /* --------------------------------------------------------------------- */
 
-static void par96_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+static void par96_interrupt(int irq, void *dev_id)
 {
        struct net_device *dev = (struct net_device *)dev_id;
        struct baycom_state *bc = netdev_priv(dev);
@@ -415,12 +416,11 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
        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;