From: H Hartley Sweeten Date: Fri, 22 Jun 2012 23:15:16 +0000 (-0700) Subject: staging: comedi: ni_daq_700: change driver registration order X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f90398294753b3f88570af1c2a68032f6ae6bfbe;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: comedi: ni_daq_700: change driver registration order 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 Cc: Ian Abbott Cc: Frank Mori Hess Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_daq_700.c b/drivers/staging/comedi/drivers/ni_daq_700.c index b06792b3a70c..af4f10fd15df 100644 --- a/drivers/staging/comedi/drivers/ni_daq_700.c +++ b/drivers/staging/comedi/drivers/ni_daq_700.c @@ -443,11 +443,17 @@ static int __init dio700_cs_init(void) { int ret; - ret = pcmcia_register_driver(&dio700_cs_driver); + ret = comedi_driver_register(&driver_dio700); if (ret < 0) return ret; - return comedi_driver_register(&driver_dio700); + ret = pcmcia_register_driver(&dio700_cs_driver); + if (ret < 0) { + comedi_driver_unregister(&driver_dio700); + return ret; + } + + return 0; } module_init(dio700_cs_init);