diff mbox series

media: vpss: fix the order of resource clean up

Message ID 1553602674-531-1-git-send-email-mojha@codeaurora.org (mailing list archive)
State New, archived
Headers show
Series media: vpss: fix the order of resource clean up | expand

Commit Message

Mukesh Ojha March 26, 2019, 12:17 p.m. UTC
Clean up of resources should be in reverse order of vpss_init().
Fix this inside vpss_exit().

Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
---
 drivers/media/platform/davinci/vpss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lad, Prabhakar April 1, 2019, 7:25 a.m. UTC | #1
On Tue, Mar 26, 2019 at 12:18 PM Mukesh Ojha <mojha@codeaurora.org> wrote:
>
> Clean up of resources should be in reverse order of vpss_init().
> Fix this inside vpss_exit().
>
> Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
> ---
>  drivers/media/platform/davinci/vpss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar Lad

> diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c
> index 19cf685..e380fd3 100644
> --- a/drivers/media/platform/davinci/vpss.c
> +++ b/drivers/media/platform/davinci/vpss.c
> @@ -507,9 +507,9 @@ static int vpss_resume(struct device *dev)
>
>  static void vpss_exit(void)
>  {
> +       platform_driver_unregister(&vpss_driver);
>         iounmap(oper_cfg.vpss_regs_base2);
>         release_mem_region(VPSS_CLK_CTRL, 4);
> -       platform_driver_unregister(&vpss_driver);
>  }
>
>  static int __init vpss_init(void)
> --
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
> Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
>
diff mbox series

Patch

diff --git a/drivers/media/platform/davinci/vpss.c b/drivers/media/platform/davinci/vpss.c
index 19cf685..e380fd3 100644
--- a/drivers/media/platform/davinci/vpss.c
+++ b/drivers/media/platform/davinci/vpss.c
@@ -507,9 +507,9 @@  static int vpss_resume(struct device *dev)
 
 static void vpss_exit(void)
 {
+	platform_driver_unregister(&vpss_driver);
 	iounmap(oper_cfg.vpss_regs_base2);
 	release_mem_region(VPSS_CLK_CTRL, 4);
-	platform_driver_unregister(&vpss_driver);
 }
 
 static int __init vpss_init(void)