[<prev] [next>] [day] [month] [year] [list]
Message-ID: <201206251520.54274.hartleys@visionengravers.com>
Date: Mon, 25 Jun 2012 15:20:53 -0700
From: H Hartley Sweeten <hartleys@...ionengravers.com>
To: Linux Kernel <linux-kernel@...r.kernel.org>
CC: <devel@...verdev.osuosl.org>, <abbotti@....co.uk>,
<fmhess@...rs.sourceforge.net>, <gregkh@...uxfoundation.org>
Subject: [PATCH 05/33] staging: comedi: cb_das13_cs: 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 <hsweeten@...ionengravers.com>
Cc: Ian Abbott <abbotti@....co.uk>
Cc: Frank Mori Hess <fmhess@...rs.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists