Skip to content

Commit

Permalink
USB: serial: use tty_port_register_device()
Browse files Browse the repository at this point in the history
We already have the tty port when probing a usb-serial port so use
tty_port_register_device() directly instead of tty_port_install() later
to set up the port link.

This is a step towards enabling serdev for usb-serial (but we need to
determine how to handle hotplugging first).

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed May 17, 2018
1 parent 4d304a6 commit 79ef518
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/usb/serial/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ static int usb_serial_device_probe(struct device *dev)
}

minor = port->minor;
tty_dev = tty_register_device(usb_serial_tty_driver, minor, dev);
tty_dev = tty_port_register_device(&port->port, usb_serial_tty_driver,
minor, dev);
if (IS_ERR(tty_dev)) {
retval = PTR_ERR(tty_dev);
goto err_port_remove;
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int serial_install(struct tty_driver *driver, struct tty_struct *tty)
if (retval)
goto error_get_interface;

retval = tty_port_install(&port->port, driver, tty);
retval = tty_standard_install(driver, tty);
if (retval)
goto error_init_termios;

Expand Down

0 comments on commit 79ef518

Please sign in to comment.