Commit a0521f70 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

parport: Introduce module_parport_driver() helper macro

Introduce module_parport_driver() helper macro to reduce boilerplate
in the existing and new code.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210303091642.23929-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ffb597b2
...@@ -332,9 +332,19 @@ int __must_check __parport_register_driver(struct parport_driver *, ...@@ -332,9 +332,19 @@ int __must_check __parport_register_driver(struct parport_driver *,
__parport_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) __parport_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
/* Unregister a high-level driver. */ /* Unregister a high-level driver. */
extern void parport_unregister_driver (struct parport_driver *);
void parport_unregister_driver(struct parport_driver *); void parport_unregister_driver(struct parport_driver *);
/**
* module_parport_driver() - Helper macro for registering a modular parport driver
* @__parport_driver: struct parport_driver to be used
*
* Helper macro for parport drivers which do not do anything special in module
* init and 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_parport_driver(__parport_driver) \
module_driver(__parport_driver, parport_register_driver, parport_unregister_driver)
/* If parport_register_driver doesn't fit your needs, perhaps /* If parport_register_driver doesn't fit your needs, perhaps
* parport_find_xxx does. */ * parport_find_xxx does. */
extern struct parport *parport_find_number (int); extern struct parport *parport_find_number (int);
......
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