From 4225beb4017dc6fbfbb50cdf785051797bebc7e0 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 2 Mar 2012 16:22:01 +0800 Subject: [PATCH] --- yaml --- r: 292042 b: refs/heads/master c: 7d530d32b0b71f1735a73f5b03e22955a5460b7f h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/regulator/max1586.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 75a70c5574ef..b9a5f3493cbe 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8148ed6e6618598729efa53d3a1f905379de801e +refs/heads/master: 7d530d32b0b71f1735a73f5b03e22955a5460b7f diff --git a/trunk/drivers/regulator/max1586.c b/trunk/drivers/regulator/max1586.c index 40e7a4db2853..282d2ee0604e 100644 --- a/trunk/drivers/regulator/max1586.c +++ b/trunk/drivers/regulator/max1586.c @@ -76,8 +76,8 @@ static int max1586_v3_set(struct regulator_dev *rdev, int min_uV, int max_uV, if (min_uV < max1586->min_uV) min_uV = max1586->min_uV; - *selector = ((min_uV - max1586->min_uV) * MAX1586_V3_MAX_VSEL + - range_uV - 1) / range_uV; + *selector = DIV_ROUND_UP((min_uV - max1586->min_uV) * + MAX1586_V3_MAX_VSEL, range_uV); if (max1586_v3_calc_voltage(max1586, *selector) > max_uV) return -EINVAL;