Re: [PATCH 17/42] drm: ingenic: Use devm_of_reserved_mem_device_init()

Paul Cercueil <[email protected]>
Newsgroups org.kernel.vger.linux-remoteproc,dev.linux.lists.imx,dev.linux.lists.linux-staging,dev.linux.lists.linux-sunxi,org.freedesktop.lists.dri-devel,org.infradead.lists.linux-mediatek,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-media,org.kernel.vger.linux-mips,org.kernel.vger.linux-mmc,org.kernel.vger.linux-sound,org.kernel.vger.linux-tegra,org.ozlabs.lists.linux-aspeed,org.ozlabs.lists.linuxppc-dev,org.ozlabs.lists.openbmc
Message-ID <[email protected]>
Hi,

Le samedi 04 juillet 2026 à 01:08 +0530, Mukesh Ojha a écrit :
> Replace the hand-rolled devm wrapper (ingenic_drm_release_rmem +
> devm_add_action_or_reset) with the standard
> devm_of_reserved_mem_device_init(), letting the device resource
> manager handle cleanup automatically.
> 
> Signed-off-by: Mukesh Ojha <[email protected]>

Reviewed-by: Paul Cercueil <[email protected]>

Cheers,
-Paul

> ---
>  drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 13 +------------
>  1 file changed, 1 insertion(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> index 7e569af22391..990c3b4625fa 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
> @@ -1060,11 +1060,6 @@ static void ingenic_drm_unbind_all(void *d)
>  	component_unbind_all(priv->dev, &priv->drm);
>  }
>  
> -static void __maybe_unused ingenic_drm_release_rmem(void *d)
> -{
> -	of_reserved_mem_device_release(d);
> -}
> -
>  static void ingenic_drm_configure_hwdesc(struct ingenic_drm *priv,
>  					 unsigned int hwdesc,
>  					 unsigned int next_hwdesc,
> u32 id)
> @@ -1127,16 +1122,10 @@ static int ingenic_drm_bind(struct device
> *dev, bool has_components)
>  	}
>  
>  	if (IS_ENABLED(CONFIG_OF_RESERVED_MEM)) {
> -		ret = of_reserved_mem_device_init(dev);
> +		ret = devm_of_reserved_mem_device_init(dev);
>  
>  		if (ret && ret != -ENODEV)
>  			dev_warn(dev, "Failed to get reserved
> memory: %d\n", ret);
> -
> -		if (!ret) {
> -			ret = devm_add_action_or_reset(dev,
> ingenic_drm_release_rmem, dev);
> -			if (ret)
> -				return ret;
> -		}
>  	}
>  
>  	priv = devm_drm_dev_alloc(dev, &ingenic_drm_driver_data,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.