staging: comedi: das08_cs: change driver registration order
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 2 Jul 2012 22:43:52 +0000 (15:43 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Jul 2012 22:51:18 +0000 (15:51 -0700)
As done with the other comedi driver types, register the
comedi_driver first then the pcmcia_driver. Also, make sure
the pcmcia_driver registration succeeds and unregister the
comedi_driver if it fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/das08_cs.c

index 14dfc81d78c6d82efc771eb558d72a65072095e4..493078a26a7a221f65964177471d4dcc205f630f 100644 (file)
@@ -239,11 +239,18 @@ static int __init das08_cs_init_module(void)
 {
        int ret;
 
-       ret = pcmcia_register_driver(&das08_cs_driver);
+       ret = comedi_driver_register(&driver_das08_cs);
        if (ret < 0)
                return ret;
 
-       return comedi_driver_register(&driver_das08_cs);
+       ret = pcmcia_register_driver(&das08_cs_driver);
+       if (ret < 0) {
+               comedi_driver_unregister(&driver_das08_cs);
+               return ret;
+       }
+
+       return 0;
+
 }
 module_init(das08_cs_init_module);