diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-13 21:05:31 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-13 21:05:31 -0800 |
commit | fb0255fb2941ef6f21742b2bc146d6b9aef4fedc (patch) | |
tree | 8334f3485152b1c887ddfe04ba9a95c8a704481c /drivers/tty/serial/8250/8250_core.c | |
parent | Merge tag 'staging-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging (diff) | |
parent | tty: ehv_bytechan: fix spelling mistake (diff) | |
download | wireguard-linux-fb0255fb2941ef6f21742b2bc146d6b9aef4fedc.tar.xz wireguard-linux-fb0255fb2941ef6f21742b2bc146d6b9aef4fedc.zip |
Merge tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Pull tty/serial updates from Greg KH:
"Here is the big tty/serial driver pull request for 4.15-rc1.
Lots of serial driver updates in here, some small vt cleanups, and a
raft of SPDX and license boilerplate cleanups, messing up the diffstat
a bit.
Nothing major, with no realy functional changes except better hardware
support for some platforms.
All of these have been in linux-next for a while with no reported
issues"
* tag 'tty-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (110 commits)
tty: ehv_bytechan: fix spelling mistake
tty: serial: meson: allow baud-rates lower than 9600
serial: 8250_fintek: Fix crash with baud rate B0
serial: 8250_fintek: Disable delays for ports != 0
serial: 8250_fintek: Return -EINVAL on invalid configuration
tty: Remove redundant license text
tty: serdev: Remove redundant license text
tty: hvc: Remove redundant license text
tty: serial: Remove redundant license text
tty: add SPDX identifiers to all remaining files in drivers/tty/
tty: serial: jsm: remove redundant pointer ts
tty: serial: jsm: add space before the open parenthesis '('
tty: serial: jsm: fix coding style
tty: serial: jsm: delete space between function name and '('
tty: serial: jsm: add blank line after declarations
tty: serial: jsm: change the type of local variable
tty: serial: imx: remove dead code imx_dma_rxint
tty: serial: imx: disable ageing timer interrupt if dma in use
serial: 8250: fix potential deadlock in rs485-mode
serial: m32r_sio: Drop redundant .data assignment
...
Diffstat (limited to 'drivers/tty/serial/8250/8250_core.c')
-rw-r--r-- | drivers/tty/serial/8250/8250_core.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c index d29b512a7d9f..d64afdd93872 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0+ /* * Universal/legacy driver for 8250/16550-type serial ports * @@ -11,11 +12,6 @@ * userspace-configurable "phantom" ports * "serial8250" platform devices * serial8250_register_8250_port() ports - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. */ #include <linux/module.h> @@ -262,17 +258,17 @@ static void serial_unlink_irq_chain(struct uart_8250_port *up) * barely passable results for a 16550A. (Although at the expense * of much CPU overhead). */ -static void serial8250_timeout(unsigned long data) +static void serial8250_timeout(struct timer_list *t) { - struct uart_8250_port *up = (struct uart_8250_port *)data; + struct uart_8250_port *up = from_timer(up, t, timer); up->port.handle_irq(&up->port); mod_timer(&up->timer, jiffies + uart_poll_timeout(&up->port)); } -static void serial8250_backup_timeout(unsigned long data) +static void serial8250_backup_timeout(struct timer_list *t) { - struct uart_8250_port *up = (struct uart_8250_port *)data; + struct uart_8250_port *up = from_timer(up, t, timer); unsigned int iir, ier = 0, lsr; unsigned long flags; @@ -329,8 +325,7 @@ static int univ8250_setup_irq(struct uart_8250_port *up) if (up->bugs & UART_BUG_THRE) { pr_debug("ttyS%d - using backup timer\n", serial_index(port)); - up->timer.function = serial8250_backup_timeout; - up->timer.data = (unsigned long)up; + up->timer.function = (TIMER_FUNC_TYPE)serial8250_backup_timeout; mod_timer(&up->timer, jiffies + uart_poll_timeout(port) + HZ / 5); } @@ -341,7 +336,6 @@ static int univ8250_setup_irq(struct uart_8250_port *up) * driver used to do this with IRQ0. */ if (!port->irq) { - up->timer.data = (unsigned long)up; mod_timer(&up->timer, jiffies + uart_poll_timeout(port)); } else retval = serial_link_irq_chain(up); @@ -354,7 +348,7 @@ static void univ8250_release_irq(struct uart_8250_port *up) struct uart_port *port = &up->port; del_timer_sync(&up->timer); - up->timer.function = serial8250_timeout; + up->timer.function = (TIMER_FUNC_TYPE)serial8250_timeout; if (port->irq) serial_unlink_irq_chain(up); } @@ -525,8 +519,7 @@ static void __init serial8250_isa_init_ports(void) base_ops = port->ops; port->ops = &univ8250_port_ops; - init_timer(&up->timer); - up->timer.function = serial8250_timeout; + timer_setup(&up->timer, serial8250_timeout, 0); up->ops = &univ8250_driver_ops; |