Patchwork [1/2] mtd: bf5xx_nand: Use module_platform_driver()

login
register
mail settings
Submitter Sachin Kamat
Date March 18, 2013, 11:16 a.m.
Message ID <1363605410-4530-1-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/228569/
State New
Headers show

Comments

Sachin Kamat - March 18, 2013, 11:16 a.m.
module_platform_driver macro removes some boilerplate and makes
the code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mtd/nand/bf5xx_nand.c |   16 +---------------
 1 files changed, 1 insertions(+), 15 deletions(-)
Sachin Kamat - April 1, 2013, 10:18 a.m.
On 18 March 2013 16:46, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>
> module_platform_driver macro removes some boilerplate and makes
> the code simpler.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/mtd/nand/bf5xx_nand.c |   16 +---------------
>  1 files changed, 1 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
> index 4271e94..776df36 100644
> --- a/drivers/mtd/nand/bf5xx_nand.c
> +++ b/drivers/mtd/nand/bf5xx_nand.c
> @@ -874,21 +874,7 @@ static struct platform_driver bf5xx_nand_driver = {
>         },
>  };
>
> -static int __init bf5xx_nand_init(void)
> -{
> -       printk(KERN_INFO "%s, Version %s (c) 2007 Analog Devices, Inc.\n",
> -               DRV_DESC, DRV_VERSION);
> -
> -       return platform_driver_register(&bf5xx_nand_driver);
> -}
> -
> -static void __exit bf5xx_nand_exit(void)
> -{
> -       platform_driver_unregister(&bf5xx_nand_driver);
> -}
> -
> -module_init(bf5xx_nand_init);
> -module_exit(bf5xx_nand_exit);
> +module_platform_driver(bf5xx_nand_driver);
>
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR(DRV_AUTHOR);
> --
> 1.7.4.1
>

Ping..
Artem Bityutskiy - April 5, 2013, 12:04 p.m.
On Mon, 2013-03-18 at 16:46 +0530, Sachin Kamat wrote:
> module_platform_driver macro removes some boilerplate and makes
> the code simpler.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Pushed these 2 to l2-mtd.git too, thanks!

Patch

diff --git a/drivers/mtd/nand/bf5xx_nand.c b/drivers/mtd/nand/bf5xx_nand.c
index 4271e94..776df36 100644
--- a/drivers/mtd/nand/bf5xx_nand.c
+++ b/drivers/mtd/nand/bf5xx_nand.c
@@ -874,21 +874,7 @@  static struct platform_driver bf5xx_nand_driver = {
 	},
 };
 
-static int __init bf5xx_nand_init(void)
-{
-	printk(KERN_INFO "%s, Version %s (c) 2007 Analog Devices, Inc.\n",
-		DRV_DESC, DRV_VERSION);
-
-	return platform_driver_register(&bf5xx_nand_driver);
-}
-
-static void __exit bf5xx_nand_exit(void)
-{
-	platform_driver_unregister(&bf5xx_nand_driver);
-}
-
-module_init(bf5xx_nand_init);
-module_exit(bf5xx_nand_exit);
+module_platform_driver(bf5xx_nand_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR(DRV_AUTHOR);