Skip to content

Commit

Permalink
OMAP3+: voltage: update nominal voltage in voltdm_scale() not VC post…
Browse files Browse the repository at this point in the history
…-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 <khilman@ti.com>
  • Loading branch information
Kevin Hilman committed Sep 15, 2011
1 parent d5c1282 commit 6a62b78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions arch/arm/mach-omap2/vc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
6 changes: 5 additions & 1 deletion arch/arm/mach-omap2/voltage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 6a62b78

Please sign in to comment.