staging: comedi: cb_das13_cs: change driver registration order
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 25 Jun 2012 22:20:53 +0000 (15:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jun 2012 22:20:19 +0000 (15:20 -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 it it fails.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/cb_das16_cs.c

index 624e005..625134f 100644 (file)
@@ -784,11 +784,17 @@ static int __init das16cs_init(void)
 {
        int ret;
 
-       ret = pcmcia_register_driver(&das16cs_driver);
+       ret = comedi_driver_register(&driver_das16cs);
        if (ret < 0)
                return ret;
 
-       return comedi_driver_register(&driver_das16cs);
+       ret = pcmcia_register_driver(&das16cs_driver);
+       if (ret < 0) {
+               comedi_driver_unregister(&driver_das16cs);
+               return ret;
+       }
+
+       return 0;
 }
 module_init(das16cs_init);