aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-05-15 19:55:37 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-15 20:56:51 -0400
commit2396472f2aed86884a446109c5b51a3702028339 (patch)
tree1edfa2509dee227df1d5094ec38eb2fd8c6c517e
parentcb4c516ca14efd9dd64caf6dd3ae7558f0d480e3 (diff)
staging: comedi: refactor ii_pci20kc driver and use module_comedi_driver
Move the module_init/module_exit routines and the associated struct comedi_drive to the end of the source. This is more typical of how other drivers are written and removes the need for the forward declarations. Convert the driver to use the module_comedi_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Cc: Mori Hess <fmhess@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/comedi/drivers/ii_pci20kc.c30
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/staging/comedi/drivers/ii_pci20kc.c b/drivers/staging/comedi/drivers/ii_pci20kc.c
index e4711ef54719..6b1b5c88ca88 100644
--- a/drivers/staging/comedi/drivers/ii_pci20kc.c
+++ b/drivers/staging/comedi/drivers/ii_pci20kc.c
@@ -159,17 +159,6 @@ struct pci20xxx_private {
159#define devpriv ((struct pci20xxx_private *)dev->private) 159#define devpriv ((struct pci20xxx_private *)dev->private)
160#define CHAN (CR_CHAN(it->chanlist[0])) 160#define CHAN (CR_CHAN(it->chanlist[0]))
161 161
162static int pci20xxx_attach(struct comedi_device *dev,
163 struct comedi_devconfig *it);
164static int pci20xxx_detach(struct comedi_device *dev);
165
166static struct comedi_driver driver_pci20xxx = {
167 .driver_name = "ii_pci20kc",
168 .module = THIS_MODULE,
169 .attach = pci20xxx_attach,
170 .detach = pci20xxx_detach,
171};
172
173static int pci20006_init(struct comedi_device *dev, struct comedi_subdevice *s, 162static int pci20006_init(struct comedi_device *dev, struct comedi_subdevice *s,
174 int opt0, int opt1); 163 int opt0, int opt1);
175static int pci20341_init(struct comedi_device *dev, struct comedi_subdevice *s, 164static int pci20341_init(struct comedi_device *dev, struct comedi_subdevice *s,
@@ -666,18 +655,13 @@ static unsigned int pci20xxx_di(struct comedi_device *dev,
666} 655}
667#endif 656#endif
668 657
669static int __init driver_pci20xxx_init_module(void) 658static struct comedi_driver pci20xxx_driver = {
670{ 659 .driver_name = "ii_pci20kc",
671 return comedi_driver_register(&driver_pci20xxx); 660 .module = THIS_MODULE,
672} 661 .attach = pci20xxx_attach,
673 662 .detach = pci20xxx_detach,
674static void __exit driver_pci20xxx_cleanup_module(void) 663};
675{ 664module_comedi_driver(pci20xxx_driver);
676 comedi_driver_unregister(&driver_pci20xxx);
677}
678
679module_init(driver_pci20xxx_init_module);
680module_exit(driver_pci20xxx_cleanup_module);
681 665
682MODULE_AUTHOR("Comedi http://www.comedi.org"); 666MODULE_AUTHOR("Comedi http://www.comedi.org");
683MODULE_DESCRIPTION("Comedi low-level driver"); 667MODULE_DESCRIPTION("Comedi low-level driver");