mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
drivercore: Add helper macro for platform_driver boilerplate
For simple modules that contain a single platform_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_platform_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Grant Likely <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Magnus Damm <[email protected]> Reviewed-by: Mark Brown <[email protected]> Reviewed-by: Stephen Boyd <[email protected]>
This commit is contained in:
parent
38ada214fa
commit
940ab88962
27 changed files with 63 additions and 329 deletions
|
|
@ -200,17 +200,7 @@ static struct platform_driver of_platform_serial_driver = {
|
|||
.remove = of_platform_serial_remove,
|
||||
};
|
||||
|
||||
static int __init of_platform_serial_init(void)
|
||||
{
|
||||
return platform_driver_register(&of_platform_serial_driver);
|
||||
}
|
||||
module_init(of_platform_serial_init);
|
||||
|
||||
static void __exit of_platform_serial_exit(void)
|
||||
{
|
||||
return platform_driver_unregister(&of_platform_serial_driver);
|
||||
};
|
||||
module_exit(of_platform_serial_exit);
|
||||
module_platform_driver(of_platform_serial_driver);
|
||||
|
||||
MODULE_AUTHOR("Arnd Bergmann <[email protected]>");
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
Loading…
Reference in a new issue