[PATCH] thermal: rcar-thermal: fix runtime PM cleanup
Jiawen Liu <[email protected]>
| Newsgroups | org.kernel.vger.linux-renesas-soc,org.kernel.vger.linux-kernel,org.kernel.vger.linux-pm |
|---|---|
| Message-ID | <[email protected]> |
Update rcar_thermal_probe() for the confirmed driver lifecycle defect. Keep the change limited to the concrete operation shown in the final patch. Signed-off-by: jiawen <[email protected]> --- diff --git a/drivers/thermal/renesas/rcar_thermal.c b/drivers/thermal/renesas/rcar_thermal.c --- a/drivers/thermal/renesas/rcar_thermal.c +++ b/drivers/thermal/renesas/rcar_thermal.c @@ -414,7 +414,12 @@ common->dev = dev; pm_runtime_enable(dev); - pm_runtime_get_sync(dev); + ret = pm_runtime_get_sync(dev); + if (ret < 0) { + pm_runtime_put_noidle(dev); + pm_runtime_disable(dev); + return ret; + } for (i = 0; i < chip->nirqs; i++) { int irq;