Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d8b5dba authored by Niklas Söderlund's avatar Niklas Söderlund Committed by Greg Kroah-Hartman
Browse files

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: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20200310114709.1483860-1-niklas.soderlund+renesas@ragnatech.se


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b92d156a
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -505,8 +505,10 @@ static int rcar_thermal_probe(struct platform_device *pdev)
			res = platform_get_resource(pdev, IORESOURCE_MEM,
			res = platform_get_resource(pdev, IORESOURCE_MEM,
						    mres++);
						    mres++);
			common->base = devm_ioremap_resource(dev, res);
			common->base = devm_ioremap_resource(dev, res);
			if (IS_ERR(common->base))
			if (IS_ERR(common->base)) {
				return PTR_ERR(common->base);
				ret = PTR_ERR(common->base);
				goto error_unregister;
			}


			idle = 0; /* polling delay is not needed */
			idle = 0; /* polling delay is not needed */
		}
		}