diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2005-05-26 08:55:55 -0400 |
---|---|---|
committer | Greg KH <gregkh@suse.de> | 2005-05-31 17:13:59 -0400 |
commit | 06299db3e7f857a4985cf70dc1a5049ec12482c1 (patch) | |
tree | 115792ba36a9b4fe1f57d849c4f9ac2d0e80a90f /drivers/usb/serial/usb-serial.c | |
parent | 47900743a56dc41a053107d64054aca3e1b42157 (diff) |
[PATCH] USB: fix usb-serial generic initialization
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>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 4536f63faaea..5da76dd8fb28 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -1297,13 +1297,6 @@ static int __init usb_serial_init(void) | |||
1297 | goto exit_bus; | 1297 | goto exit_bus; |
1298 | } | 1298 | } |
1299 | 1299 | ||
1300 | /* register the generic driver, if we should */ | ||
1301 | result = usb_serial_generic_register(debug); | ||
1302 | if (result < 0) { | ||
1303 | err("%s - registering generic driver failed", __FUNCTION__); | ||
1304 | goto exit_generic; | ||
1305 | } | ||
1306 | |||
1307 | usb_serial_tty_driver->owner = THIS_MODULE; | 1300 | usb_serial_tty_driver->owner = THIS_MODULE; |
1308 | usb_serial_tty_driver->driver_name = "usbserial"; | 1301 | usb_serial_tty_driver->driver_name = "usbserial"; |
1309 | usb_serial_tty_driver->devfs_name = "usb/tts/"; | 1302 | usb_serial_tty_driver->devfs_name = "usb/tts/"; |
@@ -1329,17 +1322,24 @@ static int __init usb_serial_init(void) | |||
1329 | goto exit_tty; | 1322 | goto exit_tty; |
1330 | } | 1323 | } |
1331 | 1324 | ||
1325 | /* register the generic driver, if we should */ | ||
1326 | result = usb_serial_generic_register(debug); | ||
1327 | if (result < 0) { | ||
1328 | err("%s - registering generic driver failed", __FUNCTION__); | ||
1329 | goto exit_generic; | ||
1330 | } | ||
1331 | |||
1332 | info(DRIVER_DESC " " DRIVER_VERSION); | 1332 | info(DRIVER_DESC " " DRIVER_VERSION); |
1333 | 1333 | ||
1334 | return result; | 1334 | return result; |
1335 | 1335 | ||
1336 | exit_generic: | ||
1337 | usb_deregister(&usb_serial_driver); | ||
1338 | |||
1336 | exit_tty: | 1339 | exit_tty: |
1337 | tty_unregister_driver(usb_serial_tty_driver); | 1340 | tty_unregister_driver(usb_serial_tty_driver); |
1338 | 1341 | ||
1339 | exit_reg_driver: | 1342 | exit_reg_driver: |
1340 | usb_serial_generic_deregister(); | ||
1341 | |||
1342 | exit_generic: | ||
1343 | bus_unregister(&usb_serial_bus_type); | 1343 | bus_unregister(&usb_serial_bus_type); |
1344 | 1344 | ||
1345 | exit_bus: | 1345 | exit_bus: |