Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-05-21 08:12:57 +0200
committerJiri Slaby <jslaby@suse.cz>2019-05-21 08:12:57 +0200
commitf7e3058cfb7c67eba9b5ad12346fcb7b5323005b (patch)
tree4499a3a3f9e99b4e9d6debaebece99d8982567e3
parent31a5827b095c830e6559407b8e1df8c80164cc91 (diff)
TTY: serial_core, add ->install (bnc#1129693).
-rw-r--r--drivers/tty/serial/serial_core.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 9d4652def97d..d7692eb3d185 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -143,9 +143,6 @@ static void uart_start(struct tty_struct *tty)
struct uart_port *port;
unsigned long flags;
- if (!state)
- return;
-
port = uart_port_lock(state, flags);
__uart_start(tty);
uart_port_unlock(port, flags);
@@ -722,9 +719,6 @@ static void uart_unthrottle(struct tty_struct *tty)
struct uart_port *port;
upstat_t mask = 0;
- if (!state)
- return;
-
port = uart_port_ref(state);
if (!port)
return;
@@ -1707,6 +1701,16 @@ static void uart_dtr_rts(struct tty_port *port, int onoff)
uart_port_deref(uport);
}
+static int uart_install(struct tty_driver *driver, struct tty_struct *tty)
+{
+ struct uart_driver *drv = driver->driver_state;
+ struct uart_state *state = drv->state + tty->index;
+
+ tty->driver_data = state;
+
+ return tty_standard_install(driver, tty);
+}
+
/*
* Calls to uart_open are serialised by the tty_lock in
* drivers/tty/tty_io.c:tty_open()
@@ -1719,11 +1723,8 @@ static void uart_dtr_rts(struct tty_port *port, int onoff)
*/
static int uart_open(struct tty_struct *tty, struct file *filp)
{
- struct uart_driver *drv = tty->driver->driver_state;
- int retval, line = tty->index;
- struct uart_state *state = drv->state + line;
-
- tty->driver_data = state;
+ struct uart_state *state = tty->driver_data;
+ int retval;
retval = tty_port_open(&state->port, tty, filp);
if (retval > 0)
@@ -2421,6 +2422,7 @@ static void uart_poll_put_char(struct tty_driver *driver, int line, char ch)
#endif
static const struct tty_operations uart_ops = {
+ .install = uart_install,
.open = uart_open,
.close = uart_close,
.write = uart_write,