Skip to content

Commit

Permalink
staging: comedi: das08_cs: change driver registration order
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent 4687770 commit 36061c8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/staging/comedi/drivers/das08_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 36061c8

Please sign in to comment.