From: Arvind Yadav Date: Tue, 6 Jun 2017 09:42:37 +0000 (+0530) Subject: thermal: imx: Handle return value of clk_prepare_enable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e3bdc8d7623d5875403ad40443e7b049ae200fcd;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Eduardo Valentin --- diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index f7ec39f46ee4..4798b4b1fd77 100644 --- a/drivers/thermal/imx_thermal.c +++ b/drivers/thermal/imx_thermal.c @@ -660,8 +660,11 @@ static int imx_thermal_resume(struct device *dev) { struct imx_thermal_data *data = dev_get_drvdata(dev); struct regmap *map = data->tempmon; + int ret; - clk_prepare_enable(data->thermal_clk); + ret = clk_prepare_enable(data->thermal_clk); + if (ret) + return ret; /* Enabled thermal sensor after resume */ regmap_write(map, TEMPSENSE0 + REG_CLR, TEMPSENSE0_POWER_DOWN); regmap_write(map, TEMPSENSE0 + REG_SET, TEMPSENSE0_MEASURE_TEMP);