OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post-scale
authorKevin Hilman <khilman@ti.com>
Mon, 18 Jul 2011 23:24:17 +0000 (16:24 -0700)
committerKevin Hilman <khilman@ti.com>
Thu, 15 Sep 2011 19:09:22 +0000 (12:09 -0700)
Currently, the nominal voltage is updated in the VC post-scale function
which is common to both scaling methods.  However, this has readabiliy
problems as this update is not where it might be expected.  Instead, move
the updated into voltdm_scale() upon a successful return of voltdm->scale()

Signed-off-by: Kevin Hilman <khilman@ti.com>
arch/arm/mach-omap2/vc.c
arch/arm/mach-omap2/voltage.c

index d9e69944f0c9919d3a3839f387fb4ae97c70c2de..6e586767a904042fb0d2cac3eed93bb5cee93d62 100644 (file)
@@ -152,8 +152,6 @@ void omap_vc_post_scale(struct voltagedomain *voltdm,
        smps_delay = ((smps_steps * voltdm->pmic->step_size) /
                        voltdm->pmic->slew_rate) + 2;
        udelay(smps_delay);
-
-       voltdm->nominal_volt = target_volt;
 }
 
 /* vc_bypass_scale - VC bypass method of voltage scaling */
index 441c2d98008c1e190b9c7e1963ed7198b66ee949..64070ac1e761048caf85bf5fb4ebad2e06b85197 100644 (file)
@@ -85,7 +85,11 @@ int voltdm_scale(struct voltagedomain *voltdm,
                return -ENODATA;
        }
 
-       return voltdm->scale(voltdm, target_volt);
+       ret = voltdm->scale(voltdm, target_volt);
+       if (!ret)
+               voltdm->nominal_volt = target_volt;
+
+       return ret;
 }
 
 /**