diff options
author | Robin Gong <b38343@freescale.com> | 2012-11-22 13:45:54 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2012-11-28 16:57:03 +0800 |
commit | ce7d1e925da7af07109d1ad34a078ad451143b63 (patch) | |
tree | 466ef9d1a3cd00015d115f9ff75a66515c9f0dd2 | |
parent | f7cad7007e37d27ae76aaae4a624afc4a3cd96e6 (diff) |
ENGR00234411-2 CPUFREQ: fix one code bug on regulator restore when fail
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>
-rwxr-xr-x | arch/arm/plat-mxc/cpufreq.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/arm/plat-mxc/cpufreq.c b/arch/arm/plat-mxc/cpufreq.c index 304e5c7a523b..3d450e07d6a8 100755 --- a/arch/arm/plat-mxc/cpufreq.c +++ b/arch/arm/plat-mxc/cpufreq.c @@ -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, |