[3.5.y.z,extended,stable] Patch "regulator: max8998: Ensure enough delay time for" has been added to staging queue

Message ID 1358916190-23265-1-git-send-email-herton.krzesinski@canonical.com
State New
Headers show

Commit Message

Herton Ronaldo Krzesinski Jan. 23, 2013, 4:43 a.m.
This is a note to let you know that I have just added a patch titled

    regulator: max8998: Ensure enough delay time for

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From d9a408d96739d4f314d92035908c9c534a709f23 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Wed, 9 Jan 2013 19:34:57 +0800
Subject: [PATCH] regulator: max8998: Ensure enough delay time for

commit 81d0a6ae7befb24c06f4aa4856af7f8d1f612171 upstream.

Use DIV_ROUND_UP to prevent truncation by integer division issue.
This ensures we return enough delay time.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
 drivers/regulator/max8998.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/drivers/regulator/max8998.c b/drivers/regulator/max8998.c
index 5e56df0..b3b2984 100644
--- a/drivers/regulator/max8998.c
+++ b/drivers/regulator/max8998.c
@@ -447,7 +447,7 @@  static int max8998_set_voltage_buck_time_sel(struct regulator_dev *rdev,

 	difference = (new_selector - old_selector) * desc->step / 1000;
 	if (difference > 0)
-		return difference / ((val & 0x0f) + 1);
+		return DIV_ROUND_UP(difference, (val & 0x0f) + 1);

 	return 0;