X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fchar%2Fmxser.c;h=ea725a9964e2007075db5e814422ceed52f84ee3;hb=53ea68ecea11bcbb3451c2758ce181bd97b569a9;hp=d5c34af8752dda7121176d85da62771a89744e95;hpb=64698b694db96b8db6f379de7d2040f61c6fc7bf;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c index d5c34af..ea725a9 100644 --- a/drivers/char/mxser.c +++ b/drivers/char/mxser.c @@ -38,7 +38,6 @@ #include #include -#include #include #include #include @@ -814,7 +813,7 @@ static int mxser_init(void) /* start finding PCI board here */ #ifdef CONFIG_PCI - n = (sizeof(mxser_pcibrds) / sizeof(mxser_pcibrds[0])) - 1; + n = ARRAY_SIZE(mxser_pcibrds) - 1; index = 0; b = 0; while (b < n) { @@ -917,6 +916,9 @@ static int mxser_open(struct tty_struct *tty, struct file *filp) struct mxser_struct *info; int retval, line; + /* initialize driver_data in case something fails */ + tty->driver_data = NULL; + line = tty->index; if (line == MXSER_PORTS) return 0; @@ -979,7 +981,7 @@ static void mxser_close(struct tty_struct *tty, struct file *filp) if (tty->index == MXSER_PORTS) return; if (!info) - BUG(); + return; spin_lock_irqsave(&info->slock, flags); @@ -1980,7 +1982,7 @@ static void mxser_receive_chars(struct mxser_struct *info, int *status) spin_lock_irqsave(&info->slock, flags); - recv_room = tty->ldisc.receive_room(tty); + recv_room = tty->receive_room; if ((recv_room == 0) && (!info->ldisc_stop_rx)) { //mxser_throttle(tty); mxser_stoprx(tty);