Skip to contentSkip to conversation

drivers: video: mx3_camera: Convert mx3_camera to use module_platform_driver()

PATCH In review Fabio Estevam 2 participants 3 messages Jan 11, 2012 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: video: mx3_camera: Convert mx3_camera to use module_platform_driver()

Using module_platform_driver makes the code smaller and simpler.

---
 drivers/media/video/mx3_camera.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
drivers/media/video/mx3_camera.c +1 -13
index f44323f..7452277 100644
@@ -1286,19 +1286,7 @@ static struct platform_driver mx3_camera_driver = {
 	.remove		= __devexit_p(mx3_camera_remove),
 };
 
-
-static int __init mx3_camera_init(void)
-{
-	return platform_driver_register(&mx3_camera_driver);
-}
-
-static void __exit mx3_camera_exit(void)
-{
-	platform_driver_unregister(&mx3_camera_driver);
-}
-
-module_init(mx3_camera_init);
-module_exit(mx3_camera_exit);
+module_platform_driver(mx3_camera_driver);
 
 MODULE_DESCRIPTION("i.MX3x SoC Camera Host driver");
 MODULE_AUTHOR("Guennadi Liakhovetski <[email protected]>");
Signature · 1 line
1.7.1
#1 lore raw
Quoted 3 lines · Fabio Estevam

Using module_platform_driver makes the code smaller and simpler.

Isn't this covered by this:

http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/43200

Thanks
Guennadi

Quoted 32 lines
---
 drivers/media/video/mx3_camera.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)
drivers/media/video/mx3_camera.c +1 -13
index f44323f..7452277 100644
@@ -1286,19 +1286,7 @@ static struct platform_driver mx3_camera_driver = {
 	.remove		= __devexit_p(mx3_camera_remove),
 };
 
-
-static int __init mx3_camera_init(void)
-{
-	return platform_driver_register(&mx3_camera_driver);
-}
-
-static void __exit mx3_camera_exit(void)
-{
-	platform_driver_unregister(&mx3_camera_driver);
-}
-
-module_init(mx3_camera_init);
-module_exit(mx3_camera_exit);
+module_platform_driver(mx3_camera_driver);
 
 MODULE_DESCRIPTION("i.MX3x SoC Camera Host driver");
 MODULE_AUTHOR("Guennadi Liakhovetski <[email protected]>");
Signature · 1 line
1.7.1

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/