* [PATCH] drm/drv: switch to using devm_add_action_or_reset()
@ 2020-12-07 1:04 Tian Tao
2020-12-08 7:58 ` Thomas Zimmermann
0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-12-07 1:04 UTC (permalink / raw)
To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
Cc: dri-devel, linux-kernel
switch to using devm_add_action_or_reset() instead of devm_add_action.
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
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,
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/drv: switch to using devm_add_action_or_reset()
2020-12-07 1:04 [PATCH] drm/drv: switch to using devm_add_action_or_reset() Tian Tao
@ 2020-12-08 7:58 ` Thomas Zimmermann
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2020-12-08 7:58 UTC (permalink / raw)
To: Tian Tao, maarten.lankhorst, mripard, airlied, daniel
Cc: dri-devel, linux-kernel
[-- Attachment #1.1: Type: text/plain, Size: 1249 bytes --]
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@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@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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-08 7:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 1:04 [PATCH] drm/drv: switch to using devm_add_action_or_reset() Tian Tao
2020-12-08 7:58 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).