mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 05/33] staging: comedi: cb_das13_cs: change driver registration order
@ 2012-06-25 22:20 H Hartley Sweeten
  0 siblings, 0 replies; only message in thread
From: H Hartley Sweeten @ 2012-06-25 22:20 UTC (permalink / raw)
  To: Linux Kernel; +Cc: devel, abbotti, fmhess, gregkh

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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 624e005..625134f 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -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);
 
-- 
1.7.11


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-06-25 22:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-25 22:20 [PATCH 05/33] staging: comedi: cb_das13_cs: change driver registration order H Hartley Sweeten

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®