diff mbox

[v3,5/9] media: davinci: vpif_capture: use module_platform_driver()

Message ID 1369569612-30915-6-git-send-email-prabhakar.csengg@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Prabhakar May 26, 2013, noon UTC
From: Lad, Prabhakar <prabhakar.csengg@gmail.com>

This patch uses module_platform_driver() to simplify the code.

Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
---
 drivers/media/platform/davinci/vpif_capture.c |   28 +------------------------
 1 files changed, 1 insertions(+), 27 deletions(-)

Comments

Laurent Pinchart May 29, 2013, 3:34 a.m. UTC | #1
On Sunday 26 May 2013 17:30:08 Prabhakar Lad wrote:
> From: Lad, Prabhakar <prabhakar.csengg@gmail.com>
> 
> This patch uses module_platform_driver() to simplify the code.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/platform/davinci/vpif_capture.c |   28 +---------------------
>  1 files changed, 1 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/media/platform/davinci/vpif_capture.c
> b/drivers/media/platform/davinci/vpif_capture.c index f8b7304..38c1fba
> 100644
> --- a/drivers/media/platform/davinci/vpif_capture.c
> +++ b/drivers/media/platform/davinci/vpif_capture.c
> @@ -2338,30 +2338,4 @@ static __refdata struct platform_driver vpif_driver =
> { .remove = vpif_remove,
>  };
> 
> -/**
> - * vpif_init: initialize the vpif driver
> - *
> - * This function registers device and driver to the kernel, requests irq
> - * handler and allocates memory
> - * for channel objects
> - */
> -static __init int vpif_init(void)
> -{
> -	return platform_driver_register(&vpif_driver);
> -}
> -
> -/**
> - * vpif_cleanup : This function clean up the vpif capture resources
> - *
> - * This will un-registers device and driver to the kernel, frees
> - * requested irq handler and de-allocates memory allocated for channel
> - * objects.
> - */
> -static void vpif_cleanup(void)
> -{
> -	platform_driver_unregister(&vpif_driver);
> -}
> -
> -/* Function for module initialization and cleanup */
> -module_init(vpif_init);
> -module_exit(vpif_cleanup);
> +module_platform_driver(vpif_driver);
diff mbox

Patch

diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index f8b7304..38c1fba 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -2338,30 +2338,4 @@  static __refdata struct platform_driver vpif_driver = {
 	.remove = vpif_remove,
 };
 
-/**
- * vpif_init: initialize the vpif driver
- *
- * This function registers device and driver to the kernel, requests irq
- * handler and allocates memory
- * for channel objects
- */
-static __init int vpif_init(void)
-{
-	return platform_driver_register(&vpif_driver);
-}
-
-/**
- * vpif_cleanup : This function clean up the vpif capture resources
- *
- * This will un-registers device and driver to the kernel, frees
- * requested irq handler and de-allocates memory allocated for channel
- * objects.
- */
-static void vpif_cleanup(void)
-{
-	platform_driver_unregister(&vpif_driver);
-}
-
-/* Function for module initialization and cleanup */
-module_init(vpif_init);
-module_exit(vpif_cleanup);
+module_platform_driver(vpif_driver);