All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: am437x: Make use of the helper function devm_platform_ioremap_resource()
@ 2021-09-01  5:07 Cai Huoqing
  2021-09-05 21:49 ` Lad, Prabhakar
  0 siblings, 1 reply; 2+ messages in thread
From: Cai Huoqing @ 2021-09-01  5:07 UTC (permalink / raw)
  To: caihuoqing
  Cc: Lad, Prabhakar, Mauro Carvalho Chehab, linux-media, linux-kernel

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
---
 drivers/media/platform/am437x/am437x-vpfe.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
index 48bb0c93729c..2dfae9bc0bba 100644
--- a/drivers/media/platform/am437x/am437x-vpfe.c
+++ b/drivers/media/platform/am437x/am437x-vpfe.c
@@ -2393,7 +2393,6 @@ static int vpfe_probe(struct platform_device *pdev)
 	struct vpfe_config *vpfe_cfg;
 	struct vpfe_device *vpfe;
 	struct vpfe_ccdc *ccdc;
-	struct resource	*res;
 	int ret;
 
 	vpfe = devm_kzalloc(&pdev->dev, sizeof(*vpfe), GFP_KERNEL);
@@ -2411,8 +2410,7 @@ static int vpfe_probe(struct platform_device *pdev)
 	vpfe->cfg = vpfe_cfg;
 	ccdc = &vpfe->ccdc;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	ccdc->ccdc_cfg.base_addr = devm_ioremap_resource(&pdev->dev, res);
+	ccdc->ccdc_cfg.base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(ccdc->ccdc_cfg.base_addr)) {
 		ret = PTR_ERR(ccdc->ccdc_cfg.base_addr);
 		goto probe_out_cleanup;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] media: am437x: Make use of the helper function devm_platform_ioremap_resource()
  2021-09-01  5:07 [PATCH] media: am437x: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
@ 2021-09-05 21:49 ` Lad, Prabhakar
  0 siblings, 0 replies; 2+ messages in thread
From: Lad, Prabhakar @ 2021-09-05 21:49 UTC (permalink / raw)
  To: Cai Huoqing; +Cc: Mauro Carvalho Chehab, linux-media, LKML

Hi Cai,

Thank you for the patch.

On Wed, Sep 1, 2021 at 6:10 AM Cai Huoqing <caihuoqing@baidu.com> wrote:
>
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
>
> Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
> ---
>  drivers/media/platform/am437x/am437x-vpfe.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
Prabhakar

> diff --git a/drivers/media/platform/am437x/am437x-vpfe.c b/drivers/media/platform/am437x/am437x-vpfe.c
> index 48bb0c93729c..2dfae9bc0bba 100644
> --- a/drivers/media/platform/am437x/am437x-vpfe.c
> +++ b/drivers/media/platform/am437x/am437x-vpfe.c
> @@ -2393,7 +2393,6 @@ static int vpfe_probe(struct platform_device *pdev)
>         struct vpfe_config *vpfe_cfg;
>         struct vpfe_device *vpfe;
>         struct vpfe_ccdc *ccdc;
> -       struct resource *res;
>         int ret;
>
>         vpfe = devm_kzalloc(&pdev->dev, sizeof(*vpfe), GFP_KERNEL);
> @@ -2411,8 +2410,7 @@ static int vpfe_probe(struct platform_device *pdev)
>         vpfe->cfg = vpfe_cfg;
>         ccdc = &vpfe->ccdc;
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       ccdc->ccdc_cfg.base_addr = devm_ioremap_resource(&pdev->dev, res);
> +       ccdc->ccdc_cfg.base_addr = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(ccdc->ccdc_cfg.base_addr)) {
>                 ret = PTR_ERR(ccdc->ccdc_cfg.base_addr);
>                 goto probe_out_cleanup;
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-05 21:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  5:07 [PATCH] media: am437x: Make use of the helper function devm_platform_ioremap_resource() Cai Huoqing
2021-09-05 21:49 ` Lad, Prabhakar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.