[PATCH] drm/drv: switch to using devm_add_action_or_reset()

Thomas Zimmermann tzimmermann at suse.de
Tue Dec 8 07:58:39 UTC 2020



Am 07.12.20 um 02:04 schrieb Tian Tao:
> switch to using devm_add_action_or_reset() instead of devm_add_action.
> 
> Signed-off-by: Tian Tao <tiantao6 at hisilicon.com>

I'm surprised that devm_drm_dev_init() didn't already use 
devm_add_action_or_reset(). But it doesn't look special, so

Acked-by: Thomas Zimmermann <tzimmermann at suse.de>

> ---
>   drivers/gpu/drm/drm_drv.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c
> index 7343038..b92f7fd 100644
> --- a/drivers/gpu/drm/drm_drv.c
> +++ b/drivers/gpu/drm/drm_drv.c
> @@ -675,11 +675,8 @@ static int devm_drm_dev_init(struct device *parent,
>   	if (ret)
>   		return ret;
>   
> -	ret = devm_add_action(parent, devm_drm_dev_init_release, dev);
> -	if (ret)
> -		devm_drm_dev_init_release(dev);
> -
> -	return ret;
> +	return devm_add_action_or_reset(parent,
> +					devm_drm_dev_init_release, dev);
>   }
>   
>   void *__devm_drm_dev_alloc(struct device *parent,
> 

-- 
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20201208/ea50a733/attachment.sig>


More information about the dri-devel mailing list