summaryrefslogtreecommitdiff
path: root/drivers/thermal/imx8mm_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/imx8mm_thermal.c')
-rw-r--r--drivers/thermal/imx8mm_thermal.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/thermal/imx8mm_thermal.c b/drivers/thermal/imx8mm_thermal.c
index a1e4f9bb4cb0..7442e013738f 100644
--- a/drivers/thermal/imx8mm_thermal.c
+++ b/drivers/thermal/imx8mm_thermal.c
@@ -166,10 +166,11 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
&tmu->sensors[i],
&tmu_tz_ops);
if (IS_ERR(tmu->sensors[i].tzd)) {
+ ret = PTR_ERR(tmu->sensors[i].tzd);
dev_err(&pdev->dev,
"failed to register thermal zone sensor[%d]: %d\n",
i, ret);
- return PTR_ERR(tmu->sensors[i].tzd);
+ goto disable_clk;
}
tmu->sensors[i].hw_id = i;
}
@@ -184,6 +185,10 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
imx8mm_tmu_enable(tmu, true);
return 0;
+
+disable_clk:
+ clk_disable_unprepare(tmu->clk);
+ return ret;
}
static int imx8mm_tmu_remove(struct platform_device *pdev)