fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / net / hamradio / baycom_par.c
index 4bd7c09..5930aeb 100644 (file)
 #include <linux/hdlcdrv.h>
 #include <linux/baycom.h>
 #include <linux/parport.h>
+#include <linux/bitops.h>
+#include <linux/jiffies.h>
 
 #include <asm/system.h>
-#include <asm/bitops.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;
@@ -480,9 +480,9 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr,
 static const char *mode[NR_PORTS] = { "picpar", };
 static int iobase[NR_PORTS] = { 0x378, };
 
-MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s");
+module_param_array(mode, charp, NULL, 0);
 MODULE_PARM_DESC(mode, "baycom operating mode; eg. par96 or picpar");
-MODULE_PARM(iobase, "1-" __MODULE_STRING(NR_PORTS) "i");
+module_param_array(iobase, int, NULL, 0);
 MODULE_PARM_DESC(iobase, "baycom io base address");
 
 MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");