2021-09-01 18:43:06

by Cai,Huoqing

[permalink] [raw]
Subject: [PATCH] media: vsp1: Make use of the helper function devm_platform_ioremap_resource()

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

Signed-off-by: Cai Huoqing <[email protected]>
---
drivers/media/platform/vsp1/vsp1_drv.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index de442d6c9926..8acd6d45d8d0 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -785,7 +785,6 @@ static int vsp1_probe(struct platform_device *pdev)
struct vsp1_device *vsp1;
struct device_node *fcp_node;
struct resource *irq;
- struct resource *io;
unsigned int i;
int ret;

@@ -800,8 +799,7 @@ static int vsp1_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, vsp1);

/* I/O and IRQ resources (clock managed by the clock PM domain). */
- io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- vsp1->mmio = devm_ioremap_resource(&pdev->dev, io);
+ vsp1->mmio = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(vsp1->mmio))
return PTR_ERR(vsp1->mmio);

--
2.25.1


2021-09-01 21:50:01

by Kieran Bingham

[permalink] [raw]
Subject: Re: [PATCH] media: vsp1: Make use of the helper function devm_platform_ioremap_resource()

On 01/09/2021 06:57, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately

Reviewed-by: Kieran Bingham <[email protected]>

> Signed-off-by: Cai Huoqing <[email protected]>
> ---
> drivers/media/platform/vsp1/vsp1_drv.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
> index de442d6c9926..8acd6d45d8d0 100644
> --- a/drivers/media/platform/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> @@ -785,7 +785,6 @@ static int vsp1_probe(struct platform_device *pdev)
> struct vsp1_device *vsp1;
> struct device_node *fcp_node;
> struct resource *irq;
> - struct resource *io;
> unsigned int i;
> int ret;
>
> @@ -800,8 +799,7 @@ static int vsp1_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, vsp1);
>
> /* I/O and IRQ resources (clock managed by the clock PM domain). */
> - io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - vsp1->mmio = devm_ioremap_resource(&pdev->dev, io);
> + vsp1->mmio = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(vsp1->mmio))
> return PTR_ERR(vsp1->mmio);
>
>

2021-09-22 22:49:50

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH] media: vsp1: Make use of the helper function devm_platform_ioremap_resource()

Hi Cai,

Thank you for the patch.

On Wed, Sep 01, 2021 at 01:57:08PM +0800, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource() helper instead of
> calling platform_get_resource() and devm_ioremap_resource()
> separately
>
> Signed-off-by: Cai Huoqing <[email protected]>

Reviewed-by: Laurent Pinchart <[email protected]>

> ---
> drivers/media/platform/vsp1/vsp1_drv.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
> index de442d6c9926..8acd6d45d8d0 100644
> --- a/drivers/media/platform/vsp1/vsp1_drv.c
> +++ b/drivers/media/platform/vsp1/vsp1_drv.c
> @@ -785,7 +785,6 @@ static int vsp1_probe(struct platform_device *pdev)
> struct vsp1_device *vsp1;
> struct device_node *fcp_node;
> struct resource *irq;
> - struct resource *io;
> unsigned int i;
> int ret;
>
> @@ -800,8 +799,7 @@ static int vsp1_probe(struct platform_device *pdev)
> platform_set_drvdata(pdev, vsp1);
>
> /* I/O and IRQ resources (clock managed by the clock PM domain). */
> - io = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - vsp1->mmio = devm_ioremap_resource(&pdev->dev, io);
> + vsp1->mmio = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(vsp1->mmio))
> return PTR_ERR(vsp1->mmio);
>

--
Regards,

Laurent Pinchart