Skip to content

Commit 84472c3

Browse files
peterhurleygregkh
authored andcommitted
staging/fwserial: Don't use deprecated alloc_tty_driver()
Use tty_alloc_driver() instead. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 4df5bb0 commit 84472c3

1 file changed

Lines changed: 9 additions & 12 deletions

File tree

‎drivers/staging/fwserial/fwserial.c‎

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2891,9 +2891,10 @@ static int __init fwserial_init(void)
28912891
num_ttys = MAX_CARD_PORTS - num_loops;
28922892
num_ports = num_ttys + num_loops;
28932893

2894-
fwtty_driver = alloc_tty_driver(MAX_TOTAL_PORTS);
2895-
if (!fwtty_driver) {
2896-
err = -ENOMEM;
2894+
fwtty_driver = tty_alloc_driver(MAX_TOTAL_PORTS, TTY_DRIVER_REAL_RAW
2895+
| TTY_DRIVER_DYNAMIC_DEV);
2896+
if (IS_ERR(fwtty_driver)) {
2897+
err = PTR_ERR(fwtty_driver);
28972898
return err;
28982899
}
28992900

@@ -2903,9 +2904,6 @@ static int __init fwserial_init(void)
29032904
fwtty_driver->minor_start = 0;
29042905
fwtty_driver->type = TTY_DRIVER_TYPE_SERIAL;
29052906
fwtty_driver->subtype = SERIAL_TYPE_NORMAL;
2906-
fwtty_driver->flags = TTY_DRIVER_REAL_RAW |
2907-
TTY_DRIVER_DYNAMIC_DEV;
2908-
29092907
fwtty_driver->init_termios = tty_std_termios;
29102908
fwtty_driver->init_termios.c_cflag |= CLOCAL;
29112909
tty_set_operations(fwtty_driver, &fwtty_ops);
@@ -2917,9 +2915,11 @@ static int __init fwserial_init(void)
29172915
}
29182916

29192917
if (create_loop_dev) {
2920-
fwloop_driver = alloc_tty_driver(MAX_TOTAL_PORTS / num_ports);
2921-
if (!fwloop_driver) {
2922-
err = -ENOMEM;
2918+
fwloop_driver = tty_alloc_driver(MAX_TOTAL_PORTS / num_ports,
2919+
TTY_DRIVER_REAL_RAW
2920+
| TTY_DRIVER_DYNAMIC_DEV);
2921+
if (IS_ERR(fwloop_driver)) {
2922+
err = PTR_ERR(fwloop_driver);
29232923
goto unregister_driver;
29242924
}
29252925

@@ -2929,9 +2929,6 @@ static int __init fwserial_init(void)
29292929
fwloop_driver->minor_start = 0;
29302930
fwloop_driver->type = TTY_DRIVER_TYPE_SERIAL;
29312931
fwloop_driver->subtype = SERIAL_TYPE_NORMAL;
2932-
fwloop_driver->flags = TTY_DRIVER_REAL_RAW |
2933-
TTY_DRIVER_DYNAMIC_DEV;
2934-
29352932
fwloop_driver->init_termios = tty_std_termios;
29362933
fwloop_driver->init_termios.c_cflag |= CLOCAL;
29372934
tty_set_operations(fwloop_driver, &fwloop_ops);

0 commit comments

Comments
 (0)