diff mbox

[3.6.0-,4/5] media/soc_camera: use module_platform_driver macro

Message ID 1349894040-8127-1-git-send-email-srinivas.kandagatla@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas KANDAGATLA Oct. 10, 2012, 6:34 p.m. UTC
From: Srinivas Kandagatla <srinivas.kandagatla@st.com>

This patch removes some code duplication by using
module_platform_driver.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
---
 drivers/media/platform/soc_camera/soc_camera.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

Comments

Guennadi Liakhovetski Oct. 22, 2012, 4:01 p.m. UTC | #1
Hi Srinivas

On Wed, 10 Oct 2012, Srinivas KANDAGATLA wrote:

> From: Srinivas Kandagatla <srinivas.kandagatla@st.com>
> 
> This patch removes some code duplication by using
> module_platform_driver.
> 
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>

Thanks for the patch. It is indeed correct, but an identical patch is 
already upstream: 
http://git.linuxtv.org/media_tree.git/commit/ec0341b3b7817a5e8ebcf26091dde28dce2d7821

Thanks
Guennadi

> ---
>  drivers/media/platform/soc_camera/soc_camera.c |   14 +-------------
>  1 files changed, 1 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
> index 3be9294..d4bfe29 100644
> --- a/drivers/media/platform/soc_camera/soc_camera.c
> +++ b/drivers/media/platform/soc_camera/soc_camera.c
> @@ -1585,19 +1585,7 @@ static struct platform_driver __refdata soc_camera_pdrv = {
>  		.owner	= THIS_MODULE,
>  	},
>  };
> -
> -static int __init soc_camera_init(void)
> -{
> -	return platform_driver_register(&soc_camera_pdrv);
> -}
> -
> -static void __exit soc_camera_exit(void)
> -{
> -	platform_driver_unregister(&soc_camera_pdrv);
> -}
> -
> -module_init(soc_camera_init);
> -module_exit(soc_camera_exit);
> +module_platform_driver(soc_camera_pdrv);
>  
>  MODULE_DESCRIPTION("Image capture bus driver");
>  MODULE_AUTHOR("Guennadi Liakhovetski <kernel@pengutronix.de>");
> -- 
> 1.7.0.4
> 

---
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
diff mbox

Patch

diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 3be9294..d4bfe29 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -1585,19 +1585,7 @@  static struct platform_driver __refdata soc_camera_pdrv = {
 		.owner	= THIS_MODULE,
 	},
 };
-
-static int __init soc_camera_init(void)
-{
-	return platform_driver_register(&soc_camera_pdrv);
-}
-
-static void __exit soc_camera_exit(void)
-{
-	platform_driver_unregister(&soc_camera_pdrv);
-}
-
-module_init(soc_camera_init);
-module_exit(soc_camera_exit);
+module_platform_driver(soc_camera_pdrv);
 
 MODULE_DESCRIPTION("Image capture bus driver");
 MODULE_AUTHOR("Guennadi Liakhovetski <kernel@pengutronix.de>");