Merge series "parport: Introduce module_parport_driver() and use it" from Andy Shevchenko <andriy.shevchenko@linux.intel.com>:
Introduce module_parport_driver() and use it. Greg or Mark, since we have this series tagged, can somebody of you pick it up? Changelog v3: - added tag on patch 1 (Sudip) - Cc'ed to Greg Andy Shevchenko (3): parport: Introduce module_parport_driver() helper macro spi: butterfly: Switch to use module_parport_driver() spi: lm70llp: Switch to use module_parport_driver() drivers/spi/spi-butterfly.c | 13 +------------ drivers/spi/spi-lm70llp.c | 13 +------------ include/linux/parport.h | 12 +++++++++++- 3 files changed, 13 insertions(+), 25 deletions(-) base-commit: fe07bfda2fb9cdef8a4d4008a409bb02f35f1bd8 -- 2.30.1
This commit is contained in:
commit
2c94b1b7dd
@ -317,18 +317,7 @@ static struct parport_driver butterfly_driver = {
|
||||
.detach = butterfly_detach,
|
||||
.devmodel = true,
|
||||
};
|
||||
|
||||
static int __init butterfly_init(void)
|
||||
{
|
||||
return parport_register_driver(&butterfly_driver);
|
||||
}
|
||||
device_initcall(butterfly_init);
|
||||
|
||||
static void __exit butterfly_exit(void)
|
||||
{
|
||||
parport_unregister_driver(&butterfly_driver);
|
||||
}
|
||||
module_exit(butterfly_exit);
|
||||
module_parport_driver(butterfly_driver);
|
||||
|
||||
MODULE_DESCRIPTION("Parport Adapter driver for AVR Butterfly");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
@ -320,18 +320,7 @@ static struct parport_driver spi_lm70llp_drv = {
|
||||
.detach = spi_lm70llp_detach,
|
||||
.devmodel = true,
|
||||
};
|
||||
|
||||
static int __init init_spi_lm70llp(void)
|
||||
{
|
||||
return parport_register_driver(&spi_lm70llp_drv);
|
||||
}
|
||||
module_init(init_spi_lm70llp);
|
||||
|
||||
static void __exit cleanup_spi_lm70llp(void)
|
||||
{
|
||||
parport_unregister_driver(&spi_lm70llp_drv);
|
||||
}
|
||||
module_exit(cleanup_spi_lm70llp);
|
||||
module_parport_driver(spi_lm70llp_drv);
|
||||
|
||||
MODULE_AUTHOR("Kaiwan N Billimoria <kaiwan@designergraphix.com>");
|
||||
MODULE_DESCRIPTION(
|
||||
|
@ -332,9 +332,19 @@ int __must_check __parport_register_driver(struct parport_driver *,
|
||||
__parport_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
|
||||
|
||||
/* Unregister a high-level driver. */
|
||||
extern 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
|
||||
* parport_find_xxx does. */
|
||||
extern struct parport *parport_find_number (int);
|
||||
|
Loading…
x
Reference in New Issue
Block a user