diff options
| author | Shraddha Barke <shraddha.6596@gmail.com> | 2015-10-03 15:01:30 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 11:37:23 +0300 |
| commit | 8668984f8129d5ac7a90c6c0348e8ed4207fc145 (patch) | |
| tree | c12dffca4c6f4782cdecfbff97af051e7e6b5693 /include/linux/memory_hotplug.h | |
| parent | b565b3fbeca1e65702a37ab837ea625284809923 (diff) | |
| download | linux-8668984f8129d5ac7a90c6c0348e8ed4207fc145.tar.xz | |
Staging: most: Use module_platform_driver
Use module_platform_driver for drivers whose init and exit functions
only register and unregister, respectively. Thus remove some
boilerplate code.
A simplified version of Coccinelle patch -
@a@
identifier f, x;
@@
-static f(...) { return platform_driver_register(&x); }
@b depends on a@
identifier e, a.x;
@@
-static e(...) { platform_driver_unregister(&x); }
@c depends on a && b@
identifier a.f;
declarer name module_init;
@@
-module_init(f);
@d depends on a && b && c@
identifier b.e, a.x;
declarer name module_exit;
declarer name module_platform_driver;
@@
-module_exit(e);
+module_platform_driver(x);
Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/memory_hotplug.h')
0 files changed, 0 insertions, 0 deletions
