aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/mfd.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:41:04 -0500
commit21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch)
treed995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/tty/serial/mfd.c
parent74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff)
parent9e17df37d710f8998e9cb10a548304fe33d4a5c2 (diff)
Merge tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial patches from Greg Kroah-Hartman: "Here's the big tty/serial driver patches for 3.9-rc1. More tty port rework and fixes from Jiri here, as well as lots of individual serial driver updates and fixes. All of these have been in the linux-next tree for a while." * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits) tty: mxser: improve error handling in mxser_probe() and mxser_module_init() serial: imx: fix uninitialized variable warning serial: tegra: assume CONFIG_OF TTY: do not update atime/mtime on read/write lguest: select CONFIG_TTY to build properly. ARM defconfigs: add missing inclusions of linux/platform_device.h fb/exynos: include platform_device.h ARM: sa1100/assabet: include platform_device.h directly serial: imx: Fix recursive locking bug pps: Fix build breakage from decoupling pps from tty tty: Remove ancient hardpps() pps: Additional cleanups in uart_handle_dcd_change pps: Move timestamp read into PPS code proper pps: Don't crash the machine when exiting will do pps: Fix a use-after free bug when unregistering a source. pps: Use pps_lookup_dev to reduce ldisc coupling pps: Add pps_lookup_dev() function tty: serial: uartlite: Support uartlite on big and little endian systems tty: serial: uartlite: Fix sparse and checkpatch warnings serial/arc-uart: Miscll DT related updates (Grant's review comments) ... Fix up trivial conflicts, mostly just due to the TTY config option clashing with the EXPERIMENTAL removal.
Diffstat (limited to 'drivers/tty/serial/mfd.c')
-rw-r--r--drivers/tty/serial/mfd.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/tty/serial/mfd.c b/drivers/tty/serial/mfd.c
index 2c01344dc332..5f4765a7a5c5 100644
--- a/drivers/tty/serial/mfd.c
+++ b/drivers/tty/serial/mfd.c
@@ -387,12 +387,9 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts)
387 struct hsu_dma_buffer *dbuf = &up->rxbuf; 387 struct hsu_dma_buffer *dbuf = &up->rxbuf;
388 struct hsu_dma_chan *chan = up->rxc; 388 struct hsu_dma_chan *chan = up->rxc;
389 struct uart_port *port = &up->port; 389 struct uart_port *port = &up->port;
390 struct tty_struct *tty = port->state->port.tty; 390 struct tty_port *tport = &port->state->port;
391 int count; 391 int count;
392 392
393 if (!tty)
394 return;
395
396 /* 393 /*
397 * First need to know how many is already transferred, 394 * First need to know how many is already transferred,
398 * then check if its a timeout DMA irq, and return 395 * then check if its a timeout DMA irq, and return
@@ -423,7 +420,7 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts)
423 * explicitly set tail to 0. So head will 420 * explicitly set tail to 0. So head will
424 * always be greater than tail. 421 * always be greater than tail.
425 */ 422 */
426 tty_insert_flip_string(tty, dbuf->buf, count); 423 tty_insert_flip_string(tport, dbuf->buf, count);
427 port->icount.rx += count; 424 port->icount.rx += count;
428 425
429 dma_sync_single_for_device(up->port.dev, dbuf->dma_addr, 426 dma_sync_single_for_device(up->port.dev, dbuf->dma_addr,
@@ -437,7 +434,7 @@ void hsu_dma_rx(struct uart_hsu_port *up, u32 int_sts)
437 | (0x1 << 16) 434 | (0x1 << 16)
438 | (0x1 << 24) /* timeout bit, see HSU Errata 1 */ 435 | (0x1 << 24) /* timeout bit, see HSU Errata 1 */
439 ); 436 );
440 tty_flip_buffer_push(tty); 437 tty_flip_buffer_push(tport);
441 438
442 chan_writel(chan, HSU_CH_CR, 0x3); 439 chan_writel(chan, HSU_CH_CR, 0x3);
443 440
@@ -460,13 +457,9 @@ static void serial_hsu_stop_rx(struct uart_port *port)
460 457
461static inline void receive_chars(struct uart_hsu_port *up, int *status) 458static inline void receive_chars(struct uart_hsu_port *up, int *status)
462{ 459{
463 struct tty_struct *tty = up->port.state->port.tty;
464 unsigned int ch, flag; 460 unsigned int ch, flag;
465 unsigned int max_count = 256; 461 unsigned int max_count = 256;
466 462
467 if (!tty)
468 return;
469
470 do { 463 do {
471 ch = serial_in(up, UART_RX); 464 ch = serial_in(up, UART_RX);
472 flag = TTY_NORMAL; 465 flag = TTY_NORMAL;
@@ -522,7 +515,7 @@ static inline void receive_chars(struct uart_hsu_port *up, int *status)
522 ignore_char: 515 ignore_char:
523 *status = serial_in(up, UART_LSR); 516 *status = serial_in(up, UART_LSR);
524 } while ((*status & UART_LSR_DR) && max_count--); 517 } while ((*status & UART_LSR_DR) && max_count--);
525 tty_flip_buffer_push(tty); 518 tty_flip_buffer_push(&up->port.state->port);
526} 519}
527 520
528static void transmit_chars(struct uart_hsu_port *up) 521static void transmit_chars(struct uart_hsu_port *up)