[1/3,media] sh_veu: Use module_platform_driver_probe macro

Message ID 1362459218-13314-1-git-send-email-sachin.kamat@linaro.org (mailing list archive)
State Accepted, archived
Headers

Commit Message

Sachin Kamat March 5, 2013, 4:53 a.m. UTC
  module_platform_driver_probe() eliminates the boilerplate and simplifies
the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/media/platform/sh_veu.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
  

Comments

Guennadi Liakhovetski March 5, 2013, 6:40 a.m. UTC | #1
On Tue, 5 Mar 2013, Sachin Kamat wrote:

> module_platform_driver_probe() eliminates the boilerplate and simplifies
> the code.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Thanks, all 3 queued for 3.10

Regards
Guennadi

> ---
>  drivers/media/platform/sh_veu.c |   13 +------------
>  1 files changed, 1 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
> index 362d88e..0b32cc3 100644
> --- a/drivers/media/platform/sh_veu.c
> +++ b/drivers/media/platform/sh_veu.c
> @@ -1249,18 +1249,7 @@ static struct platform_driver __refdata sh_veu_pdrv = {
>  	},
>  };
>  
> -static int __init sh_veu_init(void)
> -{
> -	return platform_driver_probe(&sh_veu_pdrv, sh_veu_probe);
> -}
> -
> -static void __exit sh_veu_exit(void)
> -{
> -	platform_driver_unregister(&sh_veu_pdrv);
> -}
> -
> -module_init(sh_veu_init);
> -module_exit(sh_veu_exit);
> +module_platform_driver_probe(sh_veu_pdrv, sh_veu_probe);
>  
>  MODULE_DESCRIPTION("sh-mobile VEU mem2mem driver");
>  MODULE_AUTHOR("Guennadi Liakhovetski, <g.liakhovetski@gmx.de>");
> -- 
> 1.7.4.1
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
  

Patch

diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index 362d88e..0b32cc3 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -1249,18 +1249,7 @@  static struct platform_driver __refdata sh_veu_pdrv = {
 	},
 };
 
-static int __init sh_veu_init(void)
-{
-	return platform_driver_probe(&sh_veu_pdrv, sh_veu_probe);
-}
-
-static void __exit sh_veu_exit(void)
-{
-	platform_driver_unregister(&sh_veu_pdrv);
-}
-
-module_init(sh_veu_init);
-module_exit(sh_veu_exit);
+module_platform_driver_probe(sh_veu_pdrv, sh_veu_probe);
 
 MODULE_DESCRIPTION("sh-mobile VEU mem2mem driver");
 MODULE_AUTHOR("Guennadi Liakhovetski, <g.liakhovetski@gmx.de>");