Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1180553

[PATCH] regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Axel Lin <axel.lin@ingics.com>
Newsgroups linux.kernel
Subject [PATCH] regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded
Date Thu, 09 Jul 2015 10:50:02 +0200
Message-ID <pKfGO-6mA-3@gated-at.bofh.it> (permalink)
X-Original-To Mark Brown <broonie@kernel.org>
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=Tvbj7pSSG3AX96bMvZiuwsG+bNoZQQHCfm6+nao5DN0=; b=iKboWC41Wda97EOTbcW7kJfUzA889t9DKF0TCTM89TO5ISRWCHOWC5Pds5xUvM2pNM r9J/QR/GDTnG86bRD+aDPf8OSoQziaASAenlN36WQJzkMUiE5rg6IcSt/nZwhGrDqp3e LwxosoqO57GcOiFalsB2d/pWDYlyyALB/1KqxwaRS3hctT3G1BLcb7h5bM5jJl2F5jLC 0sOPOYHQ/2dQGGzVFDpvRrXOv217pdRiV+AI8NURYKxOLfR11b2GB1bqGQ6qlcqlIGEz Ii3kVX5hc14q+NeVRpLHBZdQt91uA4MiFUsTALMM7FVwzmeBXBwjbMeUf215ITdaBKxR Xq3A==
X-Gm-Message-State ALoCoQn1vyxJcnilFZ4iIvThvGnFry5yHkm4Lq07++DHSztoljfuPAhBJDf4Ea0UjlTfzI7qUfp5
X-Received by 10.70.53.99 with SMTP id a3mr29261565pdp.169.1436431734938; Thu, 09 Jul 2015 01:48:54 -0700 (PDT)
Content-Type text/plain; charset="UTF-8"
X-Mailer Evolution 3.12.10-0ubuntu1~14.10.1
MIME-Version 1.0
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 29
Organization linux.* mail to news gateway
X-Original-Cc Stephen Boyd <sboyd@codeaurora.org>, Liam Girdwood <lgirdwood@gmail.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Andy Gross <agross@codeaurora.org>
X-Original-Date Thu, 09 Jul 2015 16:48:50 +0800
X-Original-Message-ID <1436431730.19009.0.camel@ingics.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref aioe.org linux.kernel:1180553

Show key headers only | View raw


Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/regulator/qcom_spmi-regulator.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/regulator/qcom_spmi-regulator.c b/drivers/regulator/qcom_spmi-regulator.c
index 850a30a..9ef0e2f 100644
--- a/drivers/regulator/qcom_spmi-regulator.c
+++ b/drivers/regulator/qcom_spmi-regulator.c
@@ -504,8 +504,7 @@ static int spmi_regulator_select_voltage(struct spmi_regulator *vreg,
 	 * Force uV to be an allowed set point by applying a ceiling function to
 	 * the uV value.
 	 */
-	*voltage_sel = (uV - range->min_uV + range->step_uV - 1)
-			/ range->step_uV;
+	*voltage_sel = DIV_ROUND_UP(uV - range->min_uV, range->step_uV);
 	uV = *voltage_sel * range->step_uV + range->min_uV;
 
 	if (uV > max_uV) {
-- 
2.1.0



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

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

[PATCH] regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of  open-coded Axel Lin <axel.lin@ingics.com> - 2015-07-09 10:50 +0200
  Applied "regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded" to the regulator tree Mark Brown <broonie@kernel.org> - 2015-07-10 02:30 +0200

csiph-web