thermal: imx8mm: Disable the clock on probe failure

Prior to returning an error in probe, disable the previously
enabled clock.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201202232448.2692-2-festevam@gmail.com
This commit is contained in:
Fabio Estevam
2020-12-02 20:24:48 -03:00
committed by Daniel Lezcano
parent ce662ccde5
commit e57eb8b505

View File

@@ -170,7 +170,7 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
dev_err(&pdev->dev, dev_err(&pdev->dev,
"failed to register thermal zone sensor[%d]: %d\n", "failed to register thermal zone sensor[%d]: %d\n",
i, ret); i, ret);
return ret; goto disable_clk;
} }
tmu->sensors[i].hw_id = i; tmu->sensors[i].hw_id = i;
} }
@@ -185,6 +185,10 @@ static int imx8mm_tmu_probe(struct platform_device *pdev)
imx8mm_tmu_enable(tmu, true); imx8mm_tmu_enable(tmu, true);
return 0; return 0;
disable_clk:
clk_disable_unprepare(tmu->clk);
return ret;
} }
static int imx8mm_tmu_remove(struct platform_device *pdev) static int imx8mm_tmu_remove(struct platform_device *pdev)