Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Fabio Estevam and committed by
Daniel Lezcano
e57eb8b5 ce662ccd

+5 -1
+5 -1
drivers/thermal/imx8mm_thermal.c
··· 170 170 dev_err(&pdev->dev, 171 171 "failed to register thermal zone sensor[%d]: %d\n", 172 172 i, ret); 173 - return ret; 173 + goto disable_clk; 174 174 } 175 175 tmu->sensors[i].hw_id = i; 176 176 } ··· 185 185 imx8mm_tmu_enable(tmu, true); 186 186 187 187 return 0; 188 + 189 + disable_clk: 190 + clk_disable_unprepare(tmu->clk); 191 + return ret; 188 192 } 189 193 190 194 static int imx8mm_tmu_remove(struct platform_device *pdev)