]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
thermal: imx: Handle return value of clk_prepare_enable
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 6 Jun 2017 09:42:37 +0000 (15:12 +0530)
committerEduardo Valentin <edubezval@gmail.com>
Fri, 30 Jun 2017 23:41:55 +0000 (16:41 -0700)
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>
drivers/thermal/imx_thermal.c

index f7ec39f46ee4d8fd1f538a95a90958868855f607..4798b4b1fd77f309e19cad3f627b728858b22b35 100644 (file)
@@ -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);