aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/mxser.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-14 00:05:31 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-14 00:05:31 -0500
commitfb0255fb2941ef6f21742b2bc146d6b9aef4fedc (patch)
tree8334f3485152b1c887ddfe04ba9a95c8a704481c /drivers/tty/mxser.c
parent449fcf3ab0baf3dde9952385e6789f2ca10c3980 (diff)
parent57f5d648c45c3d40a3257c06629c14fd53c383bc (diff)
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/mxser.c')
-rw-r--r--drivers/tty/mxser.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index 7dd38047ba23..8bc15cb67a58 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -1,3 +1,4 @@
1// SPDX-License-Identifier: GPL-2.0+
1/* 2/*
2 * mxser.c -- MOXA Smartio/Industio family multiport serial driver. 3 * mxser.c -- MOXA Smartio/Industio family multiport serial driver.
3 * 4 *
@@ -8,11 +9,6 @@
8 * Linux serial driver, written by Linus Torvalds, Theodore T'so and 9 * Linux serial driver, written by Linus Torvalds, Theodore T'so and
9 * others. 10 * others.
10 * 11 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * Fed through a cleanup, indent and remove of non 2.6 code by Alan Cox 12 * Fed through a cleanup, indent and remove of non 2.6 code by Alan Cox
17 * <alan@lxorguk.ukuu.org.uk>. The original 1.8 code is available on 13 * <alan@lxorguk.ukuu.org.uk>. The original 1.8 code is available on
18 * www.moxa.com. 14 * www.moxa.com.
@@ -642,8 +638,7 @@ static int mxser_set_baud(struct tty_struct *tty, long newspd)
642 * This routine is called to set the UART divisor registers to match 638 * This routine is called to set the UART divisor registers to match
643 * the specified baud rate for a serial port. 639 * the specified baud rate for a serial port.
644 */ 640 */
645static int mxser_change_speed(struct tty_struct *tty, 641static int mxser_change_speed(struct tty_struct *tty)
646 struct ktermios *old_termios)
647{ 642{
648 struct mxser_port *info = tty->driver_data; 643 struct mxser_port *info = tty->driver_data;
649 unsigned cflag, cval, fcr; 644 unsigned cflag, cval, fcr;
@@ -945,7 +940,7 @@ static int mxser_activate(struct tty_port *port, struct tty_struct *tty)
945 /* 940 /*
946 * and set the speed of the serial port 941 * and set the speed of the serial port
947 */ 942 */
948 mxser_change_speed(tty, NULL); 943 mxser_change_speed(tty);
949 spin_unlock_irqrestore(&info->slock, flags); 944 spin_unlock_irqrestore(&info->slock, flags);
950 945
951 return 0; 946 return 0;
@@ -1288,7 +1283,7 @@ static int mxser_set_serial_info(struct tty_struct *tty,
1288 if (tty_port_initialized(port)) { 1283 if (tty_port_initialized(port)) {
1289 if (flags != (port->flags & ASYNC_SPD_MASK)) { 1284 if (flags != (port->flags & ASYNC_SPD_MASK)) {
1290 spin_lock_irqsave(&info->slock, sl_flags); 1285 spin_lock_irqsave(&info->slock, sl_flags);
1291 mxser_change_speed(tty, NULL); 1286 mxser_change_speed(tty);
1292 spin_unlock_irqrestore(&info->slock, sl_flags); 1287 spin_unlock_irqrestore(&info->slock, sl_flags);
1293 } 1288 }
1294 } else { 1289 } else {
@@ -1946,7 +1941,7 @@ static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termi
1946 unsigned long flags; 1941 unsigned long flags;
1947 1942
1948 spin_lock_irqsave(&info->slock, flags); 1943 spin_lock_irqsave(&info->slock, flags);
1949 mxser_change_speed(tty, old_termios); 1944 mxser_change_speed(tty);
1950 spin_unlock_irqrestore(&info->slock, flags); 1945 spin_unlock_irqrestore(&info->slock, flags);
1951 1946
1952 if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) { 1947 if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) {
@@ -2375,8 +2370,7 @@ static void mxser_release_ISA_res(struct mxser_board *brd)
2375 mxser_release_vector(brd); 2370 mxser_release_vector(brd);
2376} 2371}
2377 2372
2378static int mxser_initbrd(struct mxser_board *brd, 2373static int mxser_initbrd(struct mxser_board *brd)
2379 struct pci_dev *pdev)
2380{ 2374{
2381 struct mxser_port *info; 2375 struct mxser_port *info;
2382 unsigned int i; 2376 unsigned int i;
@@ -2640,7 +2634,7 @@ static int mxser_probe(struct pci_dev *pdev,
2640 } 2634 }
2641 2635
2642 /* mxser_initbrd will hook ISR. */ 2636 /* mxser_initbrd will hook ISR. */
2643 retval = mxser_initbrd(brd, pdev); 2637 retval = mxser_initbrd(brd);
2644 if (retval) 2638 if (retval)
2645 goto err_rel3; 2639 goto err_rel3;
2646 2640
@@ -2746,7 +2740,7 @@ static int __init mxser_module_init(void)
2746 brd->info->name, ioaddr[b]); 2740 brd->info->name, ioaddr[b]);
2747 2741
2748 /* mxser_initbrd will hook ISR. */ 2742 /* mxser_initbrd will hook ISR. */
2749 if (mxser_initbrd(brd, NULL) < 0) { 2743 if (mxser_initbrd(brd) < 0) {
2750 mxser_release_ISA_res(brd); 2744 mxser_release_ISA_res(brd);
2751 brd->info = NULL; 2745 brd->info = NULL;
2752 continue; 2746 continue;