Commit 5319aaa9 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Mark Brown

regulator: lp87565: Use bitfield helpers

Use the FIELD_PREP() helper, instead open-coding the same operation.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://msgid.link/r/5e8781d31c983caf6bdabe36c5552077422cb8da.1708002575.git.geert+renesas@glider.beSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 64db3e8d
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/ * Copyright (C) 2017 Texas Instruments Incorporated - https://www.ti.com/
*/ */
#include <linux/bitfield.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/regmap.h> #include <linux/regmap.h>
...@@ -99,7 +100,7 @@ static int lp87565_buck_set_ramp_delay(struct regulator_dev *rdev, ...@@ -99,7 +100,7 @@ static int lp87565_buck_set_ramp_delay(struct regulator_dev *rdev,
ret = regmap_update_bits(rdev->regmap, regulators[id].ctrl2_reg, ret = regmap_update_bits(rdev->regmap, regulators[id].ctrl2_reg,
LP87565_BUCK_CTRL_2_SLEW_RATE, LP87565_BUCK_CTRL_2_SLEW_RATE,
reg << __ffs(LP87565_BUCK_CTRL_2_SLEW_RATE)); FIELD_PREP(LP87565_BUCK_CTRL_2_SLEW_RATE, reg));
if (ret) { if (ret) {
dev_err(&rdev->dev, "SLEW RATE write failed: %d\n", ret); dev_err(&rdev->dev, "SLEW RATE write failed: %d\n", ret);
return 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