From 6a62b78d9aa6661cae1a7d30b574daf435a14c47 Mon Sep 17 00:00:00 2001 From: Kevin Hilman Date: Mon, 18 Jul 2011 16:24:17 -0700 Subject: OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post-scale 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 --- arch/arm/mach-omap2/voltage.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-omap2/voltage.c') diff --git a/arch/arm/mach-omap2/voltage.c b/arch/arm/mach-omap2/voltage.c index 441c2d98008..64070ac1e76 100644 --- a/arch/arm/mach-omap2/voltage.c +++ b/arch/arm/mach-omap2/voltage.c @@ -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; } /** -- cgit v1.2.3