On Tue, Aug 31, 2021 at 03:43:19PM +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 <caihuoq...@baidu.com>

Acked-by: Liviu Dudau <liviu.du...@arm.com>

Many thanks,
Liviu

> ---
>  drivers/gpu/drm/arm/hdlcd_drv.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 479c2422a2e0..72e63c8fad4e 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -129,7 +129,6 @@ static int hdlcd_load(struct drm_device *drm, unsigned 
> long flags)
>  {
>       struct hdlcd_drm_private *hdlcd = drm->dev_private;
>       struct platform_device *pdev = to_platform_device(drm->dev);
> -     struct resource *res;
>       u32 version;
>       int ret;
>  
> @@ -144,8 +143,7 @@ static int hdlcd_load(struct drm_device *drm, unsigned 
> long flags)
>       atomic_set(&hdlcd->dma_end_count, 0);
>  #endif
>  
> -     res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -     hdlcd->mmio = devm_ioremap_resource(drm->dev, res);
> +     hdlcd->mmio = devm_platform_ioremap_resource(pdev, 0);
>       if (IS_ERR(hdlcd->mmio)) {
>               DRM_ERROR("failed to map control registers area\n");
>               ret = PTR_ERR(hdlcd->mmio);
> -- 
> 2.25.1
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯

Reply via email to