Skip to content

Commit

Permalink
staging: comedi: cb_das13_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 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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 26, 2012
1 parent 6f47503 commit 64c205f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/staging/comedi/drivers/cb_das16_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 64c205f

Please sign in to comment.