1
0
Fork 0

thermal: rcar_thermal: Handle probe error gracefully

[ Upstream commit 39056e8a98 ]

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>
5.4-rM2-2.2.x-imx-squashed
Niklas Söderlund 2020-03-10 12:47:09 +01:00 committed by Greg Kroah-Hartman
parent e978d00a3d
commit 157ff88660
1 changed files with 4 additions and 2 deletions

View File

@ -526,8 +526,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 */
}