Patchwork [1/8] mtd: txx9ndfmc: 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-1-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/224960/
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/txx9ndfmc.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
Sachin Kamat - March 13, 2013, 11:27 a.m.
Hi Artem,

On 5 March 2013 14:15, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> module_platform_driver_probe() eliminates the boilerplate and simplifies
> the code.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Does this series look good?

> ---
>  drivers/mtd/nand/txx9ndfmc.c |   13 +------------
>  1 files changed, 1 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c
> index e1e8748..7ed654c 100644
> --- a/drivers/mtd/nand/txx9ndfmc.c
> +++ b/drivers/mtd/nand/txx9ndfmc.c
> @@ -427,18 +427,7 @@ static struct platform_driver txx9ndfmc_driver = {
>         },
>  };
>
> -static int __init txx9ndfmc_init(void)
> -{
> -       return platform_driver_probe(&txx9ndfmc_driver, txx9ndfmc_probe);
> -}
> -
> -static void __exit txx9ndfmc_exit(void)
> -{
> -       platform_driver_unregister(&txx9ndfmc_driver);
> -}
> -
> -module_init(txx9ndfmc_init);
> -module_exit(txx9ndfmc_exit);
> +module_platform_driver_probe(txx9ndfmc_driver, txx9ndfmc_probe);
>
>  MODULE_LICENSE("GPL");
>  MODULE_DESCRIPTION("TXx9 SoC NAND flash controller driver");
> --
> 1.7.4.1
>
Artem Bityutskiy - March 13, 2013, 11:34 a.m.
On Tue, 2013-03-05 at 14:15 +0530, Sachin Kamat wrote:
> module_platform_driver_probe() eliminates the boilerplate and simplifies
> the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Hi,

'Jingoo Han' <jg1.han@samsung.com> sent almost identical series a little
bit earlier than you, so his series just got into the l2-mtd.git tree.
Thanks!

Patch

diff --git a/drivers/mtd/nand/txx9ndfmc.c b/drivers/mtd/nand/txx9ndfmc.c
index e1e8748..7ed654c 100644
--- a/drivers/mtd/nand/txx9ndfmc.c
+++ b/drivers/mtd/nand/txx9ndfmc.c
@@ -427,18 +427,7 @@  static struct platform_driver txx9ndfmc_driver = {
 	},
 };
 
-static int __init txx9ndfmc_init(void)
-{
-	return platform_driver_probe(&txx9ndfmc_driver, txx9ndfmc_probe);
-}
-
-static void __exit txx9ndfmc_exit(void)
-{
-	platform_driver_unregister(&txx9ndfmc_driver);
-}
-
-module_init(txx9ndfmc_init);
-module_exit(txx9ndfmc_exit);
+module_platform_driver_probe(txx9ndfmc_driver, txx9ndfmc_probe);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("TXx9 SoC NAND flash controller driver");