Patchwork [5/8] mtd: docg4: 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-5-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/224964/
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/nand/docg4.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
Mike Dunn - March 16, 2013, 7:05 p.m.
On 03/05/2013 12:45 AM, Sachin Kamat wrote:
> module_platform_driver_probe() eliminates the boilerplate and simplifies
> the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>


A bit late, but...

Acked-by: Mike Dunn <mikedunn@newsguy.com>

Thanks

Patch

diff --git a/drivers/mtd/nand/docg4.c b/drivers/mtd/nand/docg4.c
index 18fa448..fa25e7a 100644
--- a/drivers/mtd/nand/docg4.c
+++ b/drivers/mtd/nand/docg4.c
@@ -1397,18 +1397,7 @@  static struct platform_driver docg4_driver = {
 	.remove		= __exit_p(cleanup_docg4),
 };
 
-static int __init docg4_init(void)
-{
-	return platform_driver_probe(&docg4_driver, probe_docg4);
-}
-
-static void __exit docg4_exit(void)
-{
-	platform_driver_unregister(&docg4_driver);
-}
-
-module_init(docg4_init);
-module_exit(docg4_exit);
+module_platform_driver_probe(docg4_driver, probe_docg4);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mike Dunn");