linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: rcar_thermal: Handle probe error gracefully
@ 2020-03-10 11:47 Niklas Söderlund
  2020-03-10 12:42 ` Geert Uytterhoeven
  2020-03-12 11:21 ` Daniel Lezcano
  0 siblings, 2 replies; 3+ messages in thread
From: Niklas Söderlund @ 2020-03-10 11:47 UTC (permalink / raw)
  To: linux-pm, linux-renesas-soc; +Cc: Niklas Söderlund

If the common register memory resource is not available the driver needs
to fail gracefully to disable PM. Instead of returning the error
directly store it in ret and use the already existing error path.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/thermal/rcar_thermal.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
index 8f1aafa2044e5ba7..4a48d1d2a31c9250 100644
--- a/drivers/thermal/rcar_thermal.c
+++ b/drivers/thermal/rcar_thermal.c
@@ -521,8 +521,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
 			res = platform_get_resource(pdev, IORESOURCE_MEM,
 						    mres++);
 			common->base = devm_ioremap_resource(dev, res);
-			if (IS_ERR(common->base))
-				return PTR_ERR(common->base);
+			if (IS_ERR(common->base)) {
+				ret = PTR_ERR(common->base);
+				goto error_unregister;
+			}
 
 			idle = 0; /* polling delay is not needed */
 		}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal: rcar_thermal: Handle probe error gracefully
  2020-03-10 11:47 [PATCH] thermal: rcar_thermal: Handle probe error gracefully Niklas Söderlund
@ 2020-03-10 12:42 ` Geert Uytterhoeven
  2020-03-12 11:21 ` Daniel Lezcano
  1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2020-03-10 12:42 UTC (permalink / raw)
  To: Niklas Söderlund; +Cc: Linux PM list, Linux-Renesas

On Tue, Mar 10, 2020 at 12:47 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> If the common register memory resource is not available the driver needs
> to fail gracefully to disable PM. Instead of returning the error
> directly store it in ret and use the already existing error path.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal: rcar_thermal: Handle probe error gracefully
  2020-03-10 11:47 [PATCH] thermal: rcar_thermal: Handle probe error gracefully Niklas Söderlund
  2020-03-10 12:42 ` Geert Uytterhoeven
@ 2020-03-12 11:21 ` Daniel Lezcano
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel Lezcano @ 2020-03-12 11:21 UTC (permalink / raw)
  To: Niklas Söderlund, linux-pm, linux-renesas-soc

On 10/03/2020 12:47, Niklas Söderlund wrote:
> If the common register memory resource is not available the driver needs
> to fail gracefully to disable PM. Instead of returning the error
> directly store it in ret and use the already existing error path.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Applied, thanks

> ---
>  drivers/thermal/rcar_thermal.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c
> index 8f1aafa2044e5ba7..4a48d1d2a31c9250 100644
> --- a/drivers/thermal/rcar_thermal.c
> +++ b/drivers/thermal/rcar_thermal.c
> @@ -521,8 +521,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
>  			res = platform_get_resource(pdev, IORESOURCE_MEM,
>  						    mres++);
>  			common->base = devm_ioremap_resource(dev, res);
> -			if (IS_ERR(common->base))
> -				return PTR_ERR(common->base);
> +			if (IS_ERR(common->base)) {
> +				ret = PTR_ERR(common->base);
> +				goto error_unregister;
> +			}
>  
>  			idle = 0; /* polling delay is not needed */
>  		}
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-12 11:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 11:47 [PATCH] thermal: rcar_thermal: Handle probe error gracefully Niklas Söderlund
2020-03-10 12:42 ` Geert Uytterhoeven
2020-03-12 11:21 ` Daniel Lezcano

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).