Skip to content

Commit

Permalink
[PATCH] USB: fix usb-serial generic initialization
Browse files Browse the repository at this point in the history
At module load time, if a generic device is found, the tty information
for the device is not set up properly (as the tty structures aren't initialized
yet.)  This can cause big problems for things like udev.  This patch fixes this.

Thanks to Kay Sievers for the original patch for this problem.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed May 31, 2005
1 parent 4790074 commit 06299db
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/usb/serial/usb-serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,13 +1297,6 @@ static int __init usb_serial_init(void)
goto exit_bus;
}

/* register the generic driver, if we should */
result = usb_serial_generic_register(debug);
if (result < 0) {
err("%s - registering generic driver failed", __FUNCTION__);
goto exit_generic;
}

usb_serial_tty_driver->owner = THIS_MODULE;
usb_serial_tty_driver->driver_name = "usbserial";
usb_serial_tty_driver->devfs_name = "usb/tts/";
Expand All @@ -1329,17 +1322,24 @@ static int __init usb_serial_init(void)
goto exit_tty;
}

/* register the generic driver, if we should */
result = usb_serial_generic_register(debug);
if (result < 0) {
err("%s - registering generic driver failed", __FUNCTION__);
goto exit_generic;
}

info(DRIVER_DESC " " DRIVER_VERSION);

return result;

exit_generic:
usb_deregister(&usb_serial_driver);

exit_tty:
tty_unregister_driver(usb_serial_tty_driver);

exit_reg_driver:
usb_serial_generic_deregister();

exit_generic:
bus_unregister(&usb_serial_bus_type);

exit_bus:
Expand Down

0 comments on commit 06299db

Please sign in to comment.