diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 16:41:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-21 16:41:04 -0500 |
commit | 21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (patch) | |
tree | d995205afdcb7f47462bcd28067dc0c4ab0b7b02 /drivers/tty/serial/mrst_max3110.c | |
parent | 74e1a2a39355b2d3ae8c60c78d8add162c6d7183 (diff) | |
parent | 9e17df37d710f8998e9cb10a548304fe33d4a5c2 (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/mrst_max3110.c')
-rw-r--r-- | drivers/tty/serial/mrst_max3110.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/tty/serial/mrst_max3110.c b/drivers/tty/serial/mrst_max3110.c index 58734d7e746d..f641c232beca 100644 --- a/drivers/tty/serial/mrst_max3110.c +++ b/drivers/tty/serial/mrst_max3110.c | |||
@@ -339,7 +339,7 @@ static int | |||
339 | receive_chars(struct uart_max3110 *max, unsigned short *str, int len) | 339 | receive_chars(struct uart_max3110 *max, unsigned short *str, int len) |
340 | { | 340 | { |
341 | struct uart_port *port = &max->port; | 341 | struct uart_port *port = &max->port; |
342 | struct tty_struct *tty; | 342 | struct tty_port *tport; |
343 | char buf[M3110_RX_FIFO_DEPTH]; | 343 | char buf[M3110_RX_FIFO_DEPTH]; |
344 | int r, w, usable; | 344 | int r, w, usable; |
345 | 345 | ||
@@ -347,9 +347,7 @@ receive_chars(struct uart_max3110 *max, unsigned short *str, int len) | |||
347 | if (!port->state) | 347 | if (!port->state) |
348 | return 0; | 348 | return 0; |
349 | 349 | ||
350 | tty = tty_port_tty_get(&port->state->port); | 350 | tport = &port->state->port; |
351 | if (!tty) | ||
352 | return 0; | ||
353 | 351 | ||
354 | for (r = 0, w = 0; r < len; r++) { | 352 | for (r = 0, w = 0; r < len; r++) { |
355 | if (str[r] & MAX3110_BREAK && | 353 | if (str[r] & MAX3110_BREAK && |
@@ -364,20 +362,17 @@ receive_chars(struct uart_max3110 *max, unsigned short *str, int len) | |||
364 | } | 362 | } |
365 | } | 363 | } |
366 | 364 | ||
367 | if (!w) { | 365 | if (!w) |
368 | tty_kref_put(tty); | ||
369 | return 0; | 366 | return 0; |
370 | } | ||
371 | 367 | ||
372 | for (r = 0; w; r += usable, w -= usable) { | 368 | for (r = 0; w; r += usable, w -= usable) { |
373 | usable = tty_buffer_request_room(tty, w); | 369 | usable = tty_buffer_request_room(tport, w); |
374 | if (usable) { | 370 | if (usable) { |
375 | tty_insert_flip_string(tty, buf + r, usable); | 371 | tty_insert_flip_string(tport, buf + r, usable); |
376 | port->icount.rx += usable; | 372 | port->icount.rx += usable; |
377 | } | 373 | } |
378 | } | 374 | } |
379 | tty_flip_buffer_push(tty); | 375 | tty_flip_buffer_push(tport); |
380 | tty_kref_put(tty); | ||
381 | 376 | ||
382 | return r; | 377 | return r; |
383 | } | 378 | } |
@@ -493,7 +488,7 @@ static int serial_m3110_startup(struct uart_port *port) | |||
493 | | WC_BAUD_DR2; | 488 | | WC_BAUD_DR2; |
494 | 489 | ||
495 | /* as we use thread to handle tx/rx, need set low latency */ | 490 | /* as we use thread to handle tx/rx, need set low latency */ |
496 | port->state->port.tty->low_latency = 1; | 491 | port->state->port.low_latency = 1; |
497 | 492 | ||
498 | if (max->irq) { | 493 | if (max->irq) { |
499 | max->read_thread = NULL; | 494 | max->read_thread = NULL; |