Patchwork [2/4] mtd: denali_dt: Use module_platform_driver()

login
register
mail settings
Submitter Sachin Kamat
Date March 18, 2013, 9:41 a.m.
Message ID <1363599674-26933-2-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/228430/
State New
Headers show

Comments

Sachin Kamat - March 18, 2013, 9:41 a.m.
module_platform_driver() removes some boilerplate and makes the code
simpler.

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

Patch

diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c
index 02988b0..eb68979 100644
--- a/drivers/mtd/nand/denali_dt.c
+++ b/drivers/mtd/nand/denali_dt.c
@@ -150,17 +150,7 @@  static struct platform_driver denali_dt_driver = {
 	},
 };
 
-static int __init denali_init_dt(void)
-{
-	return platform_driver_register(&denali_dt_driver);
-}
-module_init(denali_init_dt);
-
-static void __exit denali_exit_dt(void)
-{
-	platform_driver_unregister(&denali_dt_driver);
-}
-module_exit(denali_exit_dt);
+module_platform_driver(denali_dt_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Jamie Iles");