ChangeSet 1.1276.22.6, 2003/08/22 15:32:20-07:00, bellucda@tiscali.it [PATCH] USB: PATCH 6/19 Audit usb_register/usb_serial_register under divers/usb/serial drivers/usb/serial/io_edgeport.c | 35 ++++++++++++++++++++++++++++------- 1 files changed, 28 insertions(+), 7 deletions(-) diff -Nru a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c --- a/drivers/usb/serial/io_edgeport.c Tue Sep 2 12:47:58 2003 +++ b/drivers/usb/serial/io_edgeport.c Tue Sep 2 12:47:58 2003 @@ -3051,15 +3051,36 @@ * edgeport_init * This is called by the module subsystem, or on startup to initialize us ****************************************************************************/ -int __init edgeport_init(void) +static int __init edgeport_init(void) { - usb_serial_register (&edgeport_1port_device); - usb_serial_register (&edgeport_2port_device); - usb_serial_register (&edgeport_4port_device); - usb_serial_register (&edgeport_8port_device); - usb_register (&io_driver); + int retval; + retval = usb_serial_register(&edgeport_1port_device); + if (retval) + goto failed_1port_device_register; + retval = usb_serial_register(&edgeport_2port_device); + if (retval) + goto failed_2port_device_register; + retval = usb_serial_register(&edgeport_4port_device); + if (retval) + goto failed_4port_device_register; + retval = usb_serial_register(&edgeport_8port_device); + if (retval) + goto failed_8port_device_register; + retval = usb_register(&io_driver); + if (retval) + goto failed_usb_register; info(DRIVER_DESC " " DRIVER_VERSION); return 0; +failed_usb_register: + usb_serial_deregister(&edgeport_8port_device); +failed_8port_device_register: + usb_serial_deregister(&edgeport_4port_device); +failed_4port_device_register: + usb_serial_deregister(&edgeport_2port_device); +failed_2port_device_register: + usb_serial_deregister(&edgeport_1port_device); +failed_1port_device_register: + return retval; } @@ -3068,7 +3089,7 @@ * edgeport_exit * Called when the driver is about to be unloaded. ****************************************************************************/ -void __exit edgeport_exit (void) +static void __exit edgeport_exit (void) { usb_deregister (&io_driver); usb_serial_deregister (&edgeport_1port_device);