[-next,2/3,media] dm644x_ccdc: remove unnecessary check of res

Message ID 20220426030544.3537713-2-yangyingliang@huawei.com (mailing list archive)
State Accepted
Delegated to: Hans Verkuil
Headers
Series [-next,1/3,media] dm355_ccdc: remove unnecessary check of res |

Commit Message

Yang Yingliang April 26, 2022, 3:05 a.m. UTC
  The resource is checked in probe function, so there is
no need do this check in remove function.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 drivers/media/platform/ti/davinci/dm644x_ccdc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Lad, Prabhakar May 18, 2022, 7:42 p.m. UTC | #1
On Tue, Apr 26, 2022 at 3:53 AM Yang Yingliang <yangyingliang@huawei.com> wrote:
>
> The resource is checked in probe function, so there is
> no need do this check in remove function.
>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>  drivers/media/platform/ti/davinci/dm644x_ccdc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
Prabhakar

> diff --git a/drivers/media/platform/ti/davinci/dm644x_ccdc.c b/drivers/media/platform/ti/davinci/dm644x_ccdc.c
> index c6378c4e0074..e4073e99914c 100644
> --- a/drivers/media/platform/ti/davinci/dm644x_ccdc.c
> +++ b/drivers/media/platform/ti/davinci/dm644x_ccdc.c
> @@ -839,8 +839,7 @@ static int dm644x_ccdc_remove(struct platform_device *pdev)
>
>         iounmap(ccdc_cfg.base_addr);
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       if (res)
> -               release_mem_region(res->start, resource_size(res));
> +       release_mem_region(res->start, resource_size(res));
>         vpfe_unregister_ccdc_device(&ccdc_hw_dev);
>         return 0;
>  }
> --
> 2.25.1
>
  

Patch

diff --git a/drivers/media/platform/ti/davinci/dm644x_ccdc.c b/drivers/media/platform/ti/davinci/dm644x_ccdc.c
index c6378c4e0074..e4073e99914c 100644
--- a/drivers/media/platform/ti/davinci/dm644x_ccdc.c
+++ b/drivers/media/platform/ti/davinci/dm644x_ccdc.c
@@ -839,8 +839,7 @@  static int dm644x_ccdc_remove(struct platform_device *pdev)
 
 	iounmap(ccdc_cfg.base_addr);
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res)
-		release_mem_region(res->start, resource_size(res));
+	release_mem_region(res->start, resource_size(res));
 	vpfe_unregister_ccdc_device(&ccdc_hw_dev);
 	return 0;
 }