* [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper
@ 2019-07-31 12:50 Geert Uytterhoeven
2019-07-31 13:30 ` Ulrich Hecht
2019-07-31 18:44 ` Niklas Söderlund
0 siblings, 2 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2019-07-31 12:50 UTC (permalink / raw)
To: Zhang Rui, Eduardo Valentin, Daniel Lezcano
Cc: Marek Vasut, linux-pm, linux-renesas-soc, linux-kernel,
Geert Uytterhoeven
Use the devm_add_action_or_reset() helper instead of open-coding the
same operations.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/thermal/rcar_gen3_thermal.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index a56463308694e937..2db7e7f8baf939fd 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -443,11 +443,10 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
if (ret)
goto error_unregister;
- ret = devm_add_action(dev, rcar_gen3_hwmon_action, zone);
- if (ret) {
- rcar_gen3_hwmon_action(zone);
+ ret = devm_add_action_or_reset(dev, rcar_gen3_hwmon_action,
+ zone);
+ if (ret)
goto error_unregister;
- }
ret = of_thermal_get_ntrips(tsc->zone);
if (ret < 0)
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper
2019-07-31 12:50 [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper Geert Uytterhoeven
@ 2019-07-31 13:30 ` Ulrich Hecht
2019-07-31 18:44 ` Niklas Söderlund
1 sibling, 0 replies; 4+ messages in thread
From: Ulrich Hecht @ 2019-07-31 13:30 UTC (permalink / raw)
To: Geert Uytterhoeven, Zhang Rui, Eduardo Valentin, Daniel Lezcano
Cc: Marek Vasut, linux-pm, linux-renesas-soc, linux-kernel
> On July 31, 2019 at 2:50 PM Geert Uytterhoeven <geert+renesas@glider.be> wrote:
>
>
> Use the devm_add_action_or_reset() helper instead of open-coding the
> same operations.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/thermal/rcar_gen3_thermal.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
> index a56463308694e937..2db7e7f8baf939fd 100644
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -443,11 +443,10 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
> if (ret)
> goto error_unregister;
>
> - ret = devm_add_action(dev, rcar_gen3_hwmon_action, zone);
> - if (ret) {
> - rcar_gen3_hwmon_action(zone);
> + ret = devm_add_action_or_reset(dev, rcar_gen3_hwmon_action,
> + zone);
> + if (ret)
> goto error_unregister;
> - }
>
> ret = of_thermal_get_ntrips(tsc->zone);
> if (ret < 0)
> --
> 2.17.1
>
Reviewed-by: Ulrich Hecht <uli+renesas@fpond.eu>
CU
Uli
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper
2019-07-31 12:50 [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper Geert Uytterhoeven
2019-07-31 13:30 ` Ulrich Hecht
@ 2019-07-31 18:44 ` Niklas Söderlund
2019-08-28 10:01 ` Zhang Rui
1 sibling, 1 reply; 4+ messages in thread
From: Niklas Söderlund @ 2019-07-31 18:44 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Zhang Rui, Eduardo Valentin, Daniel Lezcano, Marek Vasut,
linux-pm, linux-renesas-soc, linux-kernel
Hi Geert,
Thanks for your work.
On 2019-07-31 14:50:53 +0200, Geert Uytterhoeven wrote:
> Use the devm_add_action_or_reset() helper instead of open-coding the
> same operations.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> drivers/thermal/rcar_gen3_thermal.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
> index a56463308694e937..2db7e7f8baf939fd 100644
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -443,11 +443,10 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
> if (ret)
> goto error_unregister;
>
> - ret = devm_add_action(dev, rcar_gen3_hwmon_action, zone);
> - if (ret) {
> - rcar_gen3_hwmon_action(zone);
> + ret = devm_add_action_or_reset(dev, rcar_gen3_hwmon_action,
> + zone);
> + if (ret)
> goto error_unregister;
> - }
>
> ret = of_thermal_get_ntrips(tsc->zone);
> if (ret < 0)
> --
> 2.17.1
>
--
Regards,
Niklas Söderlund
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper
2019-07-31 18:44 ` Niklas Söderlund
@ 2019-08-28 10:01 ` Zhang Rui
0 siblings, 0 replies; 4+ messages in thread
From: Zhang Rui @ 2019-08-28 10:01 UTC (permalink / raw)
To: Niklas Söderlund, Geert Uytterhoeven
Cc: Eduardo Valentin, Daniel Lezcano, Marek Vasut, linux-pm,
linux-renesas-soc, linux-kernel
On Wed, 2019-07-31 at 20:44 +0200, Niklas Söderlund wrote:
> Hi Geert,
>
> Thanks for your work.
>
> On 2019-07-31 14:50:53 +0200, Geert Uytterhoeven wrote:
> > Use the devm_add_action_or_reset() helper instead of open-coding
> > the
> > same operations.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
>
Hi, Geert,
https://patchwork.kernel.org/patch/11034969/ is the same fix submitted
a few days earlier, so I will take that patch instead. Thanks for the
patch anyway.
thanks,
rui
> > ---
> > drivers/thermal/rcar_gen3_thermal.c | 7 +++----
> > 1 file changed, 3 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/thermal/rcar_gen3_thermal.c
> > b/drivers/thermal/rcar_gen3_thermal.c
> > index a56463308694e937..2db7e7f8baf939fd 100644
> > --- a/drivers/thermal/rcar_gen3_thermal.c
> > +++ b/drivers/thermal/rcar_gen3_thermal.c
> > @@ -443,11 +443,10 @@ static int rcar_gen3_thermal_probe(struct
> > platform_device *pdev)
> > if (ret)
> > goto error_unregister;
> >
> > - ret = devm_add_action(dev, rcar_gen3_hwmon_action,
> > zone);
> > - if (ret) {
> > - rcar_gen3_hwmon_action(zone);
> > + ret = devm_add_action_or_reset(dev,
> > rcar_gen3_hwmon_action,
> > + zone);
> > + if (ret)
> > goto error_unregister;
> > - }
> >
> > ret = of_thermal_get_ntrips(tsc->zone);
> > if (ret < 0)
> > --
> > 2.17.1
> >
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-08-28 10:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-31 12:50 [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper Geert Uytterhoeven
2019-07-31 13:30 ` Ulrich Hecht
2019-07-31 18:44 ` Niklas Söderlund
2019-08-28 10:01 ` Zhang Rui
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).