]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] 3c509: bus registration fix
authorAndrew Morton <akpm@osdl.org>
Wed, 8 Mar 2006 08:06:27 +0000 (00:06 -0800)
committerJeff Garzik <jeff@garzik.org>
Sat, 11 Mar 2006 18:29:09 +0000 (13:29 -0500)
- Don't call eisa_driver_unregister() if eisa_driver_register() failed.

- Properly propagate error values.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/3c509.c

index 824e430486c2720dce930244b149dcd0650a60e5..830528dce0ca72daf59744ce49d1f5cf6a74fcdb 100644 (file)
@@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL");
 
 static int __init el3_init_module(void)
 {
+       int ret = 0;
        el3_cards = 0;
 
        if (debug >= 0)
@@ -1589,14 +1590,16 @@ static int __init el3_init_module(void)
        }
 
 #ifdef CONFIG_EISA
-       if (eisa_driver_register (&el3_eisa_driver) < 0) {
-               eisa_driver_unregister (&el3_eisa_driver);
-       }
+       ret = eisa_driver_register(&el3_eisa_driver);
 #endif
 #ifdef CONFIG_MCA
-       mca_register_driver(&el3_mca_driver);
+       {
+               int err = mca_register_driver(&el3_mca_driver);
+               if (ret == 0)
+                       ret = err;
+       }
 #endif
-       return 0;
+       return ret;
 }
 
 static void __exit el3_cleanup_module(void)