summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/serial_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/serial_core.c')
-rw-r--r--drivers/tty/serial/serial_core.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 79bd2f44d765..eb1401b61a90 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2530,9 +2530,12 @@ int uart_register_driver(struct uart_driver *drv)
if (!drv->state)
goto out;
- normal = alloc_tty_driver(drv->nr);
- if (!normal)
+ normal = tty_alloc_driver(drv->nr, TTY_DRIVER_REAL_RAW |
+ TTY_DRIVER_DYNAMIC_DEV);
+ if (IS_ERR(normal)) {
+ retval = PTR_ERR(normal);
goto out_kfree;
+ }
drv->tty_driver = normal;
@@ -2545,7 +2548,6 @@ int uart_register_driver(struct uart_driver *drv)
normal->init_termios = tty_std_termios;
normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
normal->init_termios.c_ispeed = normal->init_termios.c_ospeed = 9600;
- normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
normal->driver_state = drv;
tty_set_operations(normal, &uart_ops);