Skip to content

Commit

Permalink
USB: serial: drop unused core USB driver
Browse files Browse the repository at this point in the history
Drop the usb-serial-core USB driver that was registered at module init
but then never used.

This was a remnant dating back to 2004 (!) when this struct usb_driver
was used for the generic driver; see commit bbc53b7d7322 ("USB: fix bug
where removing usb-serial modules or usb serial devices could oops") in
the tglx bitkeeper-history archive.

Note that every usb-serial driver (including the generic one) registers
its own USB (interface) driver along with its usb-serial bus drivers.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
  • Loading branch information
Johan Hovold committed Oct 13, 2017
1 parent ee13a25 commit 2944fd2
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,17 +1201,6 @@ static const struct tty_operations serial_ops = {

struct tty_driver *usb_serial_tty_driver;

/* Driver structure we register with the USB core */
static struct usb_driver usb_serial_driver = {
.name = "usbserial",
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.suspend = usb_serial_suspend,
.resume = usb_serial_resume,
.no_dynamic_id = 1,
.supports_autosuspend = 1,
};

static int __init usb_serial_init(void)
{
int result;
Expand Down Expand Up @@ -1247,13 +1236,6 @@ static int __init usb_serial_init(void)
goto exit_reg_driver;
}

/* register the USB driver */
result = usb_register(&usb_serial_driver);
if (result < 0) {
pr_err("%s - usb_register failed\n", __func__);
goto exit_tty;
}

/* register the generic driver, if we should */
result = usb_serial_generic_register();
if (result < 0) {
Expand All @@ -1264,9 +1246,6 @@ static int __init usb_serial_init(void)
return result;

exit_generic:
usb_deregister(&usb_serial_driver);

exit_tty:
tty_unregister_driver(usb_serial_tty_driver);

exit_reg_driver:
Expand All @@ -1285,7 +1264,6 @@ static void __exit usb_serial_exit(void)

usb_serial_generic_deregister();

usb_deregister(&usb_serial_driver);
tty_unregister_driver(usb_serial_tty_driver);
put_tty_driver(usb_serial_tty_driver);
bus_unregister(&usb_serial_bus_type);
Expand Down

0 comments on commit 2944fd2

Please sign in to comment.