]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00234411-2 CPUFREQ: fix one code bug on regulator restore when fail
authorRobin Gong <b38343@freescale.com>
Thu, 22 Nov 2012 05:45:54 +0000 (13:45 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:45 +0000 (08:35 +0200)
Didn't care about pu_regulator is enabled or not when regulator restore if some
regulator set failed.

Signed-off-by: Robin Gong <b38343@freescale.com>
arch/arm/plat-mxc/cpufreq.c

index 304e5c7a523b79ab26cad878e32b37834f2c6ffc..3d450e07d6a836d7aea2cee52a7fa4fa6a420dbb 100755 (executable)
@@ -184,10 +184,13 @@ err4:
        }
 
 err3:
-       ret = regulator_set_voltage(pu_regulator, org_pu_volt, org_pu_volt);
-       if (ret < 0) {
-               printk(KERN_ERR "COULD NOT RESTORE PU VOLTAGE!!!!\n");
-               goto err3;
+       if (!IS_ERR(pu_regulator) &&
+               regulator_is_enabled(pu_regulator)) {
+               ret = regulator_set_voltage(pu_regulator, org_pu_volt, org_pu_volt);
+               if (ret < 0) {
+                       printk(KERN_ERR "COULD NOT RESTORE PU VOLTAGE!!!!\n");
+                       goto err3;
+               }
        }
 err2:
        ret = regulator_set_voltage(soc_regulator, org_soc_volt,