Re: [PATCH 07/14] drm/rockchip: move to devm_platform_ioremap_resource() usage

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

 



On Tue, Jan 28, 2025 at 05:29:31PM -0500, Anusha Srivatsa wrote:
> Replace platform_get_resource + devm_ioremap_resource
> with just devm_platform_ioremap_resource()
> 
> Used Coccinelle to do this change. SmPl patch:
> @rule_1@
> identifier res;
> expression ioremap_res;
> identifier pdev;
> @@
> -struct resource *res;
> ...
> -res = platform_get_resource(pdev,...);
> -ioremap_res = devm_ioremap_resource(...);
> +ioremap_res = devm_platform_ioremap_resource(pdev,0);
> 
> Cc: Sandy Huang <hjc@xxxxxxxxxxxxxx>
> Cc: Heiko Stübner <heiko@xxxxxxxxx>
> Cc: Andy Yan <andy.yan@xxxxxxxxxxxxxx>
> Signed-off-by: Anusha Srivatsa <asrivats@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index 57747f1cff26e444ef3569983d6a7f7922f03ff7..4c639f7c868907fc35ce22f2ef7e281ad85c2d9e 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -2187,7 +2187,6 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
>  	const struct vop_data *vop_data;
>  	struct drm_device *drm_dev = data;
>  	struct vop *vop;
> -	struct resource *res;
>  	int ret, irq;
>  
>  	vop_data = of_device_get_match_data(dev);
> @@ -2207,8 +2206,7 @@ static int vop_bind(struct device *dev, struct device *master, void *data)
>  
>  	vop_win_init(vop);
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	vop->regs = devm_ioremap_resource(dev, res);
> +	vop->regs = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(vop->regs))
>  		return PTR_ERR(vop->regs);
>  	vop->len = resource_size(res);

This one will result in a compile failure too, you removed res but it's
still used on the last line.

Maxime

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux