X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fserial%2F68360serial.c;h=d9d4e9552a4d355c2458749621cf9d83898db86d;hb=0121a9829bf28c65e1a05cc881899c10d82b8de2;hp=68817a7d8c0d46c7ea33e05e3a1eeac7013a7db8;hpb=fb7665544dd60e016494cd5531f5b65ddae22ddc;p=linux-2.6-omap-h63xx.git diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 68817a7d8c0..d9d4e9552a4 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -51,6 +51,7 @@ extern int kgdb_output_string (const char* s, unsigned int count); /* #ifdef CONFIG_SERIAL_CONSOLE */ /* This seems to be a post 2.0 thing - mles */ #include +#include /* this defines the index into rs_table for the port to use */ @@ -934,8 +935,6 @@ static void change_speed(ser_info_t *info) /* * Set up parity check flag */ -#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) - info->read_status_mask = (BD_SC_EMPTY | BD_SC_OV); if (I_INPCK(info->tty)) info->read_status_mask |= BD_SC_FR | BD_SC_PR; @@ -996,10 +995,10 @@ static void rs_360_put_char(struct tty_struct *tty, unsigned char ch) volatile QUICC_BD *bdp; if (serial_paranoia_check(info, tty->name, "rs_put_char")) - return; + return 0; if (!tty) - return; + return 0; bdp = info->tx_cur; while (bdp->status & BD_SC_READY); @@ -1017,6 +1016,7 @@ static void rs_360_put_char(struct tty_struct *tty, unsigned char ch) bdp++; info->tx_cur = (QUICC_BD *)bdp; + return 1; } @@ -1247,7 +1247,7 @@ static int rs_360_tiocmget(struct tty_struct *tty, struct file *file) #ifdef modem_control unsigned char control, status; - if (serial_paranoia_check(info, tty->name, __FUNCTION__)) + if (serial_paranoia_check(info, tty->name, __func__)) return -ENODEV; if (tty->flags & (1 << TTY_IO_ERROR)) @@ -1278,12 +1278,12 @@ static int rs_360_tiocmset(struct tty_struct *tty, struct file *file, ser_info_t *info = (ser_info_t *)tty->driver_data; unsigned int arg; - if (serial_paranoia_check(info, tty->name, __FUNCTION__)) + if (serial_paranoia_check(info, tty->name, __func__)) return -ENODEV; if (tty->flags & (1 << TTY_IO_ERROR)) return -EIO; - + /* FIXME: locking on info->mcr */ if (set & TIOCM_RTS) info->mcr |= UART_MCR_RTS; if (set & TIOCM_DTR) @@ -1437,18 +1437,6 @@ static int rs_360_ioctl(struct tty_struct *tty, struct file * file, return retval; end_break(info); return 0; - case TIOCGSOFTCAR: - /* return put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg); */ - put_user(C_CLOCAL(tty) ? 1 : 0, (int *) arg); - return 0; - case TIOCSSOFTCAR: - error = get_user(arg, (unsigned int *) arg); - if (error) - return error; - tty->termios->c_cflag = - ((tty->termios->c_cflag & ~CLOCAL) | - (arg ? CLOCAL : 0)); - return 0; #ifdef maybe case TIOCSERGETLSR: /* Get line status register */ return get_lsr_info(info, (unsigned int *) arg); @@ -1527,11 +1515,6 @@ static void rs_360_set_termios(struct tty_struct *tty, struct ktermios *old_term { ser_info_t *info = (ser_info_t *)tty->driver_data; - if ( (tty->termios->c_cflag == old_termios->c_cflag) - && ( RELEVANT_IFLAG(tty->termios->c_iflag) - == RELEVANT_IFLAG(old_termios->c_iflag))) - return; - change_speed(info); #ifdef modem_control @@ -1671,8 +1654,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) rs_360_wait_until_sent(tty, info->timeout); } shutdown(info); - if (tty->driver->flush_buffer) - tty->driver->flush_buffer(tty); + rs_360_flush_buffer(tty); tty_ldisc_flush(tty); tty->closing = 0; info->event = 0; @@ -1723,6 +1705,7 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) printk("jiff=%lu...", jiffies); #endif + lock_kernel(); /* We go through the loop at least once because we can't tell * exactly when the last character exits the shifter. There can * be at least two characters waiting to be sent after the buffers @@ -1736,7 +1719,7 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) msleep_interruptible(jiffies_to_msecs(char_time)); if (signal_pending(current)) break; - if (timeout && ((orig_jiffies + timeout) < jiffies)) + if (timeout && (time_after(jiffies, orig_jiffies + timeout))) break; /* The 'tx_cur' is really the next buffer to send. We * have to back up to the previous BD and wait for it @@ -1751,6 +1734,7 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) bdp--; } while (bdp->status & BD_SC_READY); current->state = TASK_RUNNING; + unlock_kernel(); #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...done\n", lsr, jiffies); #endif