Commit 6cadd8ae authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: lp87565: Simplify lp87565_buck_set_ramp_delay

Use rdev->regmap/&rdev->dev instead of lp87565->regmap/lp87565->dev.
In additional, the lp87565->dev actually is the parent mfd device,
so the dev_err message is misleading here with lp87565->dev.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20190908035720.17748-1-axel.lin@ingics.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent c0b91344
......@@ -65,7 +65,6 @@ static int lp87565_buck_set_ramp_delay(struct regulator_dev *rdev,
int ramp_delay)
{
int id = rdev_get_id(rdev);
struct lp87565 *lp87565 = rdev_get_drvdata(rdev);
unsigned int reg;
int ret;
......@@ -86,11 +85,11 @@ static int lp87565_buck_set_ramp_delay(struct regulator_dev *rdev,
else
reg = 0;
ret = regmap_update_bits(lp87565->regmap, regulators[id].ctrl2_reg,
ret = regmap_update_bits(rdev->regmap, regulators[id].ctrl2_reg,
LP87565_BUCK_CTRL_2_SLEW_RATE,
reg << __ffs(LP87565_BUCK_CTRL_2_SLEW_RATE));
if (ret) {
dev_err(lp87565->dev, "SLEW RATE write failed: %d\n", ret);
dev_err(&rdev->dev, "SLEW RATE write failed: %d\n", ret);
return ret;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment