Commit 20416257 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: Add helper macro for comedi_driver boilerplate

Introduce the module_comedi_driver macro which is a convenience
macro for comedi driver modules similar to module_platform_driver.
It is intended to be used by drivers where the init/exit section
does nothing but register/unregister the comedi driver. By using
this macro it is possible to eliminate a few lines of boilerplate
code per comedi driver.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e8ccc11f
...@@ -298,6 +298,18 @@ int comedi_device_attach(struct comedi_device *dev, ...@@ -298,6 +298,18 @@ int comedi_device_attach(struct comedi_device *dev,
int comedi_driver_register(struct comedi_driver *); int comedi_driver_register(struct comedi_driver *);
int comedi_driver_unregister(struct comedi_driver *); int comedi_driver_unregister(struct comedi_driver *);
/**
* module_comedi_driver() - Helper macro for registering a comedi driver
* @__comedi_driver: comedi_driver struct
*
* Helper macro for comedi drivers which do not do anything special in module
* init/exit. This eliminates a lot of boilerplate. Each module may only use
* this macro once, and calling it replaces module_init() and module_exit().
*/
#define module_comedi_driver(__comedi_driver) \
module_driver(__comedi_driver, comedi_driver_register, \
comedi_driver_unregister)
void init_polling(void); void init_polling(void);
void cleanup_polling(void); void cleanup_polling(void);
void start_polling(struct comedi_device *); void start_polling(struct comedi_device *);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment