[PATCH] drm/v3d: Make use of the helper function devm_platform_ioremap_resource_byname()

Melissa Wen mwen at igalia.com
Mon Sep 20 08:31:34 UTC 2021


On 09/01, Cai Huoqing wrote:
> Use the devm_platform_ioremap_resource_byname() helper instead of
> calling platform_get_resource_byname() and devm_ioremap_resource()
> separately
> 
> Signed-off-by: Cai Huoqing <caihuoqing at baidu.com>
> ---
>  drivers/gpu/drm/v3d/v3d_drv.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c
> index 9403c3b36aca..c1deab2cf38d 100644
> --- a/drivers/gpu/drm/v3d/v3d_drv.c
> +++ b/drivers/gpu/drm/v3d/v3d_drv.c
> @@ -206,10 +206,7 @@ MODULE_DEVICE_TABLE(of, v3d_of_match);
>  static int
>  map_regs(struct v3d_dev *v3d, void __iomem **regs, const char *name)
>  {
> -	struct resource *res =
> -		platform_get_resource_byname(v3d_to_pdev(v3d), IORESOURCE_MEM, name);
> -
> -	*regs = devm_ioremap_resource(v3d->drm.dev, res);
> +	*regs = devm_platform_ioremap_resource_byname(v3d_to_pdev(v3d), name);
>  	return PTR_ERR_OR_ZERO(*regs);
>  }
lgtm.

Reviewed-by: Melissa Wen <mwen at igalia.com>
>  
> -- 
> 2.25.1
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20210920/1949f765/attachment.sig>


More information about the dri-devel mailing list