Re: [PATCH] drm/arm/hdlcd: Make use of the helper function devm_platform_ioremap_resource()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <caihuoqing@xxxxxxxxx>

Acked-by: Liviu Dudau <liviu.dudau@xxxxxxx>

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!  /
  ---------------
    ¯\_(ツ)_/¯



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux