X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=inline;f=drivers%2Fnet%2Fhamradio%2Fbaycom_ser_hdx.c;h=be596a3eb3fd9b164b6107410498d4dde7a76ace;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=f288c9241f95fe64e65701ec4d9addd953e25c31;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c index f288c9241..be596a3eb 100644 --- a/drivers/net/hamradio/baycom_ser_hdx.c +++ b/drivers/net/hamradio/baycom_ser_hdx.c @@ -69,6 +69,7 @@ #include #include #include +#include /* --------------------------------------------------------------------- */ @@ -150,7 +151,7 @@ static inline void 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; @@ -569,19 +570,15 @@ static int baycom_ioctl(struct net_device *dev, struct ifreq *ifr, { struct baycom_state *bc; struct baycom_ioctl bi; - int cmd2; - 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; - if (get_user(cmd2, (int *)ifr->ifr_data)) - return -EFAULT; switch (hi->cmd) { default: break; @@ -641,11 +638,11 @@ static char *mode[NR_PORTS] = { "ser12*", }; static int iobase[NR_PORTS] = { 0x3f8, }; static int irq[NR_PORTS] = { 4, }; -MODULE_PARM(mode, "1-" __MODULE_STRING(NR_PORTS) "s"); +module_param_array(mode, charp, NULL, 0); MODULE_PARM_DESC(mode, "baycom operating mode; * for software DCD"); -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_PARM(irq, "1-" __MODULE_STRING(NR_PORTS) "i"); +module_param_array(irq, int, NULL, 0); MODULE_PARM_DESC(irq, "baycom irq number"); MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");