X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2F68328serial.c;h=36f2fb04c052da3567c57b1d78359380b8ee0837;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=6dd522466d34fc2158d6d9bcd4ac2fa22f7fcef1;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/serial/68328serial.c b/drivers/serial/68328serial.c index 6dd522466..36f2fb04c 100644 --- a/drivers/serial/68328serial.c +++ b/drivers/serial/68328serial.c @@ -34,12 +34,13 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include @@ -757,7 +758,7 @@ static void rs_flush_chars(struct tty_struct *tty) extern void console_printn(const char * b, int count); -static int rs_write(struct tty_struct * tty, int from_user, +static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count) { int c, total = 0; @@ -779,15 +780,7 @@ static int rs_write(struct tty_struct * tty, int from_user, if (c <= 0) break; - if (from_user) { - down(&tmp_buf_sem); - copy_from_user(tmp_buf, buf, c); - c = min_t(int, c, min(SERIAL_XMIT_SIZE - info->xmit_cnt - 1, - SERIAL_XMIT_SIZE - info->xmit_head)); - memcpy(info->xmit_buf + info->xmit_head, tmp_buf, c); - up(&tmp_buf_sem); - } else - memcpy(info->xmit_buf + info->xmit_head, buf, c); + memcpy(info->xmit_buf + info->xmit_head, buf, c); info->xmit_head = (info->xmit_head + c) & (SERIAL_XMIT_SIZE-1); info->xmit_cnt += c; restore_flags(flags); @@ -1005,7 +998,7 @@ static void send_break( struct m68k_serial * info, int duration) unsigned long flags; if (!info->port) return; - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); save_flags(flags); cli(); #ifdef USE_INTS @@ -1197,8 +1190,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) #endif if (info->blocked_open) { if (info->close_delay) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(info->close_delay); + msleep_interruptible(jiffies_to_msecs(info->close_delay)); } wake_up_interruptible(&info->open_wait); }