Patchwork [8/8] mtd: docg3: Use module_platform_driver_probe macro

login
register
mail settings
Submitter Sachin Kamat
Date March 5, 2013, 8:45 a.m.
Message ID <1362473153-23515-8-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/224967/
State New
Headers show

Comments

Sachin Kamat - March 5, 2013, 8:45 a.m.
module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mtd/devices/docg3.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)

Patch

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 8510ccb..a0cfa89 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -2144,18 +2144,7 @@  static struct platform_driver g3_driver = {
 	.remove		= __exit_p(docg3_release),
 };
 
-static int __init docg3_init(void)
-{
-	return platform_driver_probe(&g3_driver, docg3_probe);
-}
-module_init(docg3_init);
-
-
-static void __exit docg3_exit(void)
-{
-	platform_driver_unregister(&g3_driver);
-}
-module_exit(docg3_exit);
+module_platform_driver_probe(g3_driver, docg3_probe);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Robert Jarzmik <robert.jarzmik@free.fr>");