diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2020-03-10 12:47:09 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-01 13:14:39 +0200 |
commit | 9d8b5dbacd6b0ca84922fb12b2a05fd7e32383a2 (patch) | |
tree | 5672d12ec24efa38edbac685f6be9ef184b9a35e /drivers/thermal | |
parent | b92d156a32b8f40974ba38e0154b327d9605946e (diff) | |
download | linux-stable-9d8b5dbacd6b0ca84922fb12b2a05fd7e32383a2.tar.gz linux-stable-9d8b5dbacd6b0ca84922fb12b2a05fd7e32383a2.tar.bz2 linux-stable-9d8b5dbacd6b0ca84922fb12b2a05fd7e32383a2.zip |
thermal: rcar_thermal: Handle probe error gracefully
[ Upstream commit 39056e8a989ef52486e063e34b4822b341e47b0e ]
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>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200310114709.1483860-1-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/rcar_thermal.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/thermal/rcar_thermal.c b/drivers/thermal/rcar_thermal.c index 4dc30e7890f6..140386d7c75a 100644 --- a/drivers/thermal/rcar_thermal.c +++ b/drivers/thermal/rcar_thermal.c @@ -505,8 +505,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 */ } |