Patchwork mtd: nand/gpio: Use module_platform_driver macro

login
register
mail settings
Submitter Sachin Kamat
Date Sept. 5, 2012, 10:01 a.m.
Message ID <1346839292-31001-1-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/181839/
State Accepted
Commit 2fe87aef33b77d66fada83f5dc57b6798ad5df07
Headers show

Comments

Sachin Kamat - Sept. 5, 2012, 10:01 a.m.
module_platform_driver simplifies the code by eliminating
module_init and module_exit calls.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mtd/nand/gpio.c |   15 +--------------
 1 files changed, 1 insertions(+), 14 deletions(-)
Sachin Kamat - Sept. 14, 2012, 3:32 p.m.
ping..

On 5 September 2012 15:31, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> module_platform_driver simplifies the code by eliminating
> module_init and module_exit calls.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/mtd/nand/gpio.c |   15 +--------------
>  1 files changed, 1 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
> index ce6a284..bc73bc5 100644
> --- a/drivers/mtd/nand/gpio.c
> +++ b/drivers/mtd/nand/gpio.c
> @@ -417,20 +417,7 @@ static struct platform_driver gpio_nand_driver = {
>         },
>  };
>
> -static int __init gpio_nand_init(void)
> -{
> -       printk(KERN_INFO "GPIO NAND driver, © 2004 Simtec Electronics\n");
> -
> -       return platform_driver_register(&gpio_nand_driver);
> -}
> -
> -static void __exit gpio_nand_exit(void)
> -{
> -       platform_driver_unregister(&gpio_nand_driver);
> -}
> -
> -module_init(gpio_nand_init);
> -module_exit(gpio_nand_exit);
> +module_platform_driver(gpio_nand_driver);
>
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
> --
> 1.7.4.1
>
Artem Bityutskiy - Sept. 22, 2012, 3:56 p.m.
On Wed, 2012-09-05 at 15:31 +0530, Sachin Kamat wrote:
> module_platform_driver simplifies the code by eliminating
> module_init and module_exit calls.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Pushed to l2-mtd.git, thanks!

Patch

diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index ce6a284..bc73bc5 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -417,20 +417,7 @@  static struct platform_driver gpio_nand_driver = {
 	},
 };
 
-static int __init gpio_nand_init(void)
-{
-	printk(KERN_INFO "GPIO NAND driver, © 2004 Simtec Electronics\n");
-
-	return platform_driver_register(&gpio_nand_driver);
-}
-
-static void __exit gpio_nand_exit(void)
-{
-	platform_driver_unregister(&gpio_nand_driver);
-}
-
-module_init(gpio_nand_init);
-module_exit(gpio_nand_exit);
+module_platform_driver(gpio_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");