From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Sangbeom Kim <sbkim73@samsung.com>,
Krzysztof Kozlowski <krzk@kernel.org>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
linux-samsung-soc@vger.kernel.org,
Liam Girdwood <lgirdwood@gmail.com>,
linux-kernel@vger.kernel.org, Axel Lin <axel.lin@ingics.com>
Subject: [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation
Date: Thu, 21 Feb 2019 21:17:22 +0800 [thread overview]
Message-ID: <20190221131722.12278-2-axel.lin@ingics.com> (raw)
In-Reply-To: <20190221131722.12278-1-axel.lin@ingics.com>
Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
drivers/regulator/s5m8767.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 5b0e1fe6723f..bb9d1a083299 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -339,13 +339,9 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
unsigned int new_sel)
{
struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
- const struct sec_voltage_desc *desc;
- int reg_id = rdev_get_id(rdev);
-
- desc = reg_voltage_map[reg_id];
if ((old_sel < new_sel) && s5m8767->ramp_delay)
- return DIV_ROUND_UP(desc->step * (new_sel - old_sel),
+ return DIV_ROUND_UP(rdev->desc->uV_step * (new_sel - old_sel),
s5m8767->ramp_delay * 1000);
return 0;
}
--
2.17.1
next prev parent reply other threads:[~2019-02-21 13:17 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-21 13:17 [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Axel Lin
2019-02-21 13:17 ` Axel Lin [this message]
2019-02-21 13:38 ` [PATCH 2/2] regulator: s5m8767: Simplify s5m8767_set_voltage_time_sel implementation Krzysztof Kozlowski
2019-02-21 13:22 ` [PATCH 1/2] regulator: s5m8767: Constify s5m8767_opmode_reg Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190221131722.12278-2-axel.lin@ingics.com \
--to=axel.lin@ingics.com \
--cc=b.zolnierkie@samsung.com \
--cc=broonie@kernel.org \
--cc=krzk@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=sbkim73@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®