Commit f9039829 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5fe9b247
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment