[PM-WIP-OPP][PATCH 2/4] omap: pm: opp: twl: use DIV_ROUND_UP

Nishanth Menon
2010-03-18T18:45:31Z

From: Phil Carmody <ext-phil.2.carmody@nokia.com>

kernel.h provides a neat function for DIV_ROUND_UP which should
be used instead of replicating it in code

Cc: Ambresh K <ambresh@ti.com>
Cc: Benoit Cousson <b-cousson@ti.com>
Cc: Eduardo Valentin <eduardo.valentin@nokia.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Sanjeev Premi <premi@ti.com>
Cc: Tero Kristo <tero.kristo@nokia.com>
Cc: Thara Gopinath <thara@ti.com>

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
---
arch/arm/plat-omap/opp_twl_tps.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/plat-omap/opp_twl_tps.c b/arch/arm/plat-omap/opp_twl_tps.c
index 468fb97..112f106 100644
--- a/arch/arm/plat-omap/opp_twl_tps.c
+++ b/arch/arm/plat-omap/opp_twl_tps.c
@@ -37,5 +37,5 @@ unsigned long omap_twl_vsel_to_uv(const u8 vsel)
u8 omap_twl_uv_to_vsel(unsigned long uv)
{
/* Round up to higher voltage */
- return (((uv + 99) / 100 - 6000) + 124) / 125;
+ return DIV_ROUND_UP(uv - 600000, 12500);
}
--
1.6.3.3