Re: [PATCH] regulator: max8997: Fix setting inappropriate valuefor ramp_delay variable

From: Liam Girdwood
Date: Fri Jul 08 2011 - 14:28:23 EST


On Thu, 2011-07-07 at 16:51 +0900, Donggeun Kim wrote:
> The ramp_delay variable can be set lower than the desired value.
> This patch fixes it.
>
> Signed-off-by: Donggeun Kim <dg77.kim@xxxxxxxxxxx>
> Signed-off-by: MyungJoo Ham <myungjoo.ham@xxxxxxxxxxx>
> Signed-off-by: KyungMin Park <kyungmin.park@xxxxxxxxxxx>
> ---
> drivers/regulator/max8997.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
> index 10d5a1d..682bc79 100644
> --- a/drivers/regulator/max8997.c
> +++ b/drivers/regulator/max8997.c
> @@ -543,7 +543,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev,
> rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) {
> /* If the voltage is increasing */
> if (org < i)
> - udelay(desc->step * (i - org) / max8997->ramp_delay);
> + udelay(DIV_ROUND_UP(desc->step * (i - org),
> + max8997->ramp_delay));
> }
>
> return ret;

Applied.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/