linux-omap  

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

Nishanth Menon
Thu, 18 Mar 2010 11:45:43 -0700

From: Phil Carmody <ext-phil.2.carm...@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 <ambr...@ti.com>
Cc: Benoit Cousson <b-cous...@ti.com>
Cc: Eduardo Valentin <eduardo.valen...@nokia.com>
Cc: Kevin Hilman <khil...@deeprootsystems.com>
Cc: Sanjeev Premi <pr...@ti.com>
Cc: Tero Kristo <tero.kri...@nokia.com>
Cc: Thara Gopinath <th...@ti.com>

Signed-off-by: Nishanth Menon <n...@ti.com>
Signed-off-by: Phil Carmody <ext-phil.2.carm...@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

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html