git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
net
/
hamradio
/
baycom_ser_hdx.c
diff --git
a/drivers/net/hamradio/baycom_ser_hdx.c
b/drivers/net/hamradio/baycom_ser_hdx.c
index
f288c92
..
be596a3
100644
(file)
--- a/
drivers/net/hamradio/baycom_ser_hdx.c
+++ b/
drivers/net/hamradio/baycom_ser_hdx.c
@@
-69,6
+69,7
@@
#include <asm/io.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
#include <asm/io.h>
#include <linux/hdlcdrv.h>
#include <linux/baycom.h>
+#include <linux/jiffies.h>
/* --------------------------------------------------------------------- */
/* --------------------------------------------------------------------- */
@@
-150,7
+151,7
@@
static inline void baycom_int_freq(struct baycom_state *bc)
* measure the interrupt frequency
*/
bc->debug_vals.cur_intcnt++;
* 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;
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;
{
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;
return -EINVAL;
- }
+
bc = netdev_priv(dev);
bc = netdev_priv(dev);
+ BUG_ON(bc->hdrv.magic != HDLCDRV_MAGIC);
if (cmd != SIOCDEVPRIVATE)
return -ENOIOCTLCMD;
if (cmd != SIOCDEVPRIVATE)
return -ENOIOCTLCMD;
- if (get_user(cmd2, (int *)ifr->ifr_data))
- return -EFAULT;
switch (hi->cmd) {
default:
break;
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, };
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_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_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");
MODULE_PARM_DESC(irq, "baycom irq number");
MODULE_AUTHOR("Thomas M. Sailer, sailer@ife.ee.ethz.ch, hb9jnx@hb9w.che.eu");