diff options
Diffstat (limited to 'drivers/tty/serial/68328serial.c')
-rw-r--r-- | drivers/tty/serial/68328serial.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c index f99a84526f82..49399470794d 100644 --- a/drivers/tty/serial/68328serial.c +++ b/drivers/tty/serial/68328serial.c | |||
@@ -262,8 +262,7 @@ static void rs_start(struct tty_struct *tty) | |||
262 | local_irq_restore(flags); | 262 | local_irq_restore(flags); |
263 | } | 263 | } |
264 | 264 | ||
265 | static void receive_chars(struct m68k_serial *info, struct tty_struct *tty, | 265 | static void receive_chars(struct m68k_serial *info, unsigned short rx) |
266 | unsigned short rx) | ||
267 | { | 266 | { |
268 | m68328_uart *uart = &uart_addr[info->line]; | 267 | m68328_uart *uart = &uart_addr[info->line]; |
269 | unsigned char ch, flag; | 268 | unsigned char ch, flag; |
@@ -293,9 +292,6 @@ static void receive_chars(struct m68k_serial *info, struct tty_struct *tty, | |||
293 | } | 292 | } |
294 | } | 293 | } |
295 | 294 | ||
296 | if(!tty) | ||
297 | goto clear_and_exit; | ||
298 | |||
299 | flag = TTY_NORMAL; | 295 | flag = TTY_NORMAL; |
300 | 296 | ||
301 | if (rx & URX_PARITY_ERROR) | 297 | if (rx & URX_PARITY_ERROR) |
@@ -305,15 +301,12 @@ static void receive_chars(struct m68k_serial *info, struct tty_struct *tty, | |||
305 | else if (rx & URX_FRAME_ERROR) | 301 | else if (rx & URX_FRAME_ERROR) |
306 | flag = TTY_FRAME; | 302 | flag = TTY_FRAME; |
307 | 303 | ||
308 | tty_insert_flip_char(tty, ch, flag); | 304 | tty_insert_flip_char(&info->tport, ch, flag); |
309 | #ifndef CONFIG_XCOPILOT_BUGS | 305 | #ifndef CONFIG_XCOPILOT_BUGS |
310 | } while((rx = uart->urx.w) & URX_DATA_READY); | 306 | } while((rx = uart->urx.w) & URX_DATA_READY); |
311 | #endif | 307 | #endif |
312 | 308 | ||
313 | tty_schedule_flip(tty); | 309 | tty_schedule_flip(&info->tport); |
314 | |||
315 | clear_and_exit: | ||
316 | return; | ||
317 | } | 310 | } |
318 | 311 | ||
319 | static void transmit_chars(struct m68k_serial *info, struct tty_struct *tty) | 312 | static void transmit_chars(struct m68k_serial *info, struct tty_struct *tty) |
@@ -367,11 +360,11 @@ irqreturn_t rs_interrupt(int irq, void *dev_id) | |||
367 | tx = uart->utx.w; | 360 | tx = uart->utx.w; |
368 | 361 | ||
369 | if (rx & URX_DATA_READY) | 362 | if (rx & URX_DATA_READY) |
370 | receive_chars(info, tty, rx); | 363 | receive_chars(info, rx); |
371 | if (tx & UTX_TX_AVAIL) | 364 | if (tx & UTX_TX_AVAIL) |
372 | transmit_chars(info, tty); | 365 | transmit_chars(info, tty); |
373 | #else | 366 | #else |
374 | receive_chars(info, tty, rx); | 367 | receive_chars(info, rx); |
375 | #endif | 368 | #endif |
376 | tty_kref_put(tty); | 369 | tty_kref_put(tty); |
377 | 370 | ||
@@ -1009,7 +1002,7 @@ static void rs_close(struct tty_struct *tty, struct file * filp) | |||
1009 | m68328_uart *uart = &uart_addr[info->line]; | 1002 | m68328_uart *uart = &uart_addr[info->line]; |
1010 | unsigned long flags; | 1003 | unsigned long flags; |
1011 | 1004 | ||
1012 | if (!info || serial_paranoia_check(info, tty->name, "rs_close")) | 1005 | if (serial_paranoia_check(info, tty->name, "rs_close")) |
1013 | return; | 1006 | return; |
1014 | 1007 | ||
1015 | local_irq_save(flags); | 1008 | local_irq_save(flags); |