X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fserial%2F68360serial.c;h=f148022b6b4e739e729fbe52f24bada0acd4646a;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=64e296ad3b60830822b697a5bb9a903da825a295;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/drivers/serial/68360serial.c b/drivers/serial/68360serial.c index 64e296ad3..f148022b6 100644 --- a/drivers/serial/68360serial.c +++ b/drivers/serial/68360serial.c @@ -700,12 +700,8 @@ static void do_softint(void *private_) if (!tty) return; - if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) { - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); - wake_up_interruptible(&tty->write_wait); - } + if (test_and_clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) + tty_wakeup(tty); } @@ -1051,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; @@ -1083,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; @@ -1152,10 +1140,7 @@ static void rs_360_flush_buffer(struct tty_struct *tty) /* There is nothing to "flush", whatever we gave the CPM * is on its way out. */ - wake_up_interruptible(&tty->write_wait); - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && - tty->ldisc.write_wakeup) - (tty->ldisc.write_wakeup)(tty); + tty_wakeup(tty); info->flags &= ~TX_WAKEUP; } @@ -1411,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 @@ -1716,15 +1701,13 @@ static void rs_360_close(struct tty_struct *tty, struct file * filp) shutdown(info); if (tty->driver->flush_buffer) tty->driver->flush_buffer(tty); - if (tty->ldisc.flush_buffer) - tty->ldisc.flush_buffer(tty); + tty_ldisc_flush(tty); tty->closing = 0; info->event = 0; 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); } @@ -1777,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)) @@ -2592,7 +2574,7 @@ int rs_360_init(void) state->icount.rx = state->icount.tx = 0; state->icount.frame = state->icount.parity = 0; state->icount.overrun = state->icount.brk = 0; - printk(KERN_INFO "ttyS%02d at irq 0x%02x is an %s\n", + printk(KERN_INFO "ttyS%d at irq 0x%02x is an %s\n", i, (unsigned int)(state->irq), (state->smc_scc_num & NUM_IS_SCC) ? "SCC" : "SMC");