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

thermal: imx: Handle return value of clk_prepare_enable

clk_prepare_enable() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by

Arvind Yadav and committed by
Eduardo Valentin
e3bdc8d7 f19b1a17

+4 -1
+4 -1
drivers/thermal/imx_thermal.c
··· 660 660 { 661 661 struct imx_thermal_data *data = dev_get_drvdata(dev); 662 662 struct regmap *map = data->tempmon; 663 + int ret; 663 664 664 - clk_prepare_enable(data->thermal_clk); 665 + ret = clk_prepare_enable(data->thermal_clk); 666 + if (ret) 667 + return ret; 665 668 /* Enabled thermal sensor after resume */ 666 669 regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); 667 670 regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP);