diff mbox series

thermal/drivers/imx: add missing pm_runtime_put on error path

Message ID 20220217044132.1980370-1-dominique.martinet@atmark-techno.com
State New
Headers show
Series thermal/drivers/imx: add missing pm_runtime_put on error path | expand

Commit Message

Dominique Martinet Feb. 17, 2022, 4:41 a.m. UTC
We took a reference so need to put it back when imx_get_temp() returns
EAGAIN.

Fixes: 4cf2ddf16e17 ("thermal/drivers/imx: Implement runtime PM support")
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
stumbled upon this merging our stable tree, but I don't actually use
imx-thermal so haven't tested it.

 drivers/thermal/imx_thermal.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 16663373b682..641f90f9c750 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -265,6 +265,7 @@  static int imx_get_temp(struct thermal_zone_device *tz, int *temp)
 
 	if ((val & soc_data->temp_valid_mask) == 0) {
 		dev_dbg(&tz->device, "temp measurement never finished\n");
+		pm_runtime_put(data->dev);
 		return -EAGAIN;
 	}