X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2F68360serial.c;h=5529298823caa471e6884fbc3b993422947beb6e;hb=a6d8dea2993ef90fb69b81372daa0b63f8aa940e;hp=cd2d62cd15823e5f66c02868cd85809fabe10982;hpb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;p=linux-2.6.git diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index cd2d62cd1..552929882 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -159,8 +159,8 @@ struct serial_state { int count; u8 *iomem_base; u16 iomem_reg_shift; - unsigned short close_delay; - unsigned short closing_wait; /* time to wait before closing */ + unsigned int close_delay; + unsigned int closing_wait; /* time to wait before closing */ struct async_icount_24 icount; int io_type; struct async_struct *info; @@ -244,8 +244,8 @@ typedef struct serial_info { int line; int x_char; /* xon/xoff character */ int close_delay; - unsigned short closing_wait; - unsigned short closing_wait2; + unsigned int closing_wait; + unsigned int closing_wait2; unsigned long event; unsigned long last_active; int blocked_open; /* # of blocked opens */ @@ -1047,7 +1047,7 @@ static void rs_360_put_char(struct tty_struct *tty, unsigned char ch) } -static int rs_360_write(struct tty_struct * tty, int from_user, +static int rs_360_write(struct tty_struct * tty, const unsigned char *buf, int count) { int c, ret = 0; @@ -1079,16 +1079,8 @@ static int rs_360_write(struct tty_struct * tty, int from_user, break; } - if (from_user) { - if (copy_from_user((void *)bdp->buf, buf, c)) { - if (!ret) - ret = -EFAULT; - break; - } - } else { - /* memcpy(__va(bdp->buf), buf, c); */ - memcpy((void *)bdp->buf, buf, c); - } + /* memcpy(__va(bdp->buf), buf, c); */ + memcpy((void *)bdp->buf, buf, c); bdp->length = c; bdp->status |= BD_SC_READY; @@ -1404,7 +1396,7 @@ static void end_break(ser_info_t *info) */ static void send_break(ser_info_t *info, int duration) { - current->state = TASK_INTERRUPTIBLE; + set_current_state(TASK_INTERRUPTIBLE); #ifdef SERIAL_DEBUG_SEND_BREAK printk("rs_send_break(%d) jiff=%lu...", duration, jiffies); #endif @@ -1715,8 +1707,7 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) info->tty = 0; 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); } @@ -1769,9 +1760,8 @@ static void rs_360_wait_until_sent(struct tty_struct *tty, int timeout) #ifdef SERIAL_DEBUG_RS_WAIT_UNTIL_SENT printk("lsr = %d (jiff=%lu)...", lsr, jiffies); #endif - current->state = TASK_INTERRUPTIBLE; /* current->counter = 0; make us low-priority */ - schedule_timeout(char_time); + msleep_interruptible(jiffies_to_msecs(char_time)); if (signal_pending(current)) break; if (timeout && ((orig_jiffies + timeout) < jiffies))