[PATCH 17/42] drm: ingenic: Use devm_of_reserved_mem_device_init()
Paul Cercueil
paul at crapouillou.net
Tue Jul 7 11:06:50 PDT 2026
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 <mukesh.ojha at oss.qualcomm.com>
Reviewed-by: Paul Cercueil <paul at crapouillou.net>
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,
More information about the Linux-mediatek
mailing list