Skip to content

Commit

Permalink
regulator: lp873x: Use bitfield helpers
Browse files Browse the repository at this point in the history
Use the FIELD_PREP() helper, instead open-coding the same operation.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://msgid.link/r/15edeaa9a644c4025234088da3dabb023fce04ac.1708002503.git.geert+renesas@glider.be
Signed-off-by: Mark Brown <broonie@kernel.org>
Geert Uytterhoeven authored and Mark Brown committed Feb 15, 2024

Unverified

No user is associated with the committer email.
1 parent 5319aaa commit 2601b6f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/regulator/lp873x-regulator.c
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
* Copyright (C) 2016 Texas Instruments Incorporated - https://www.ti.com/
*/

#include <linux/bitfield.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/regmap.h>
@@ -93,7 +94,7 @@ static int lp873x_buck_set_ramp_delay(struct regulator_dev *rdev,

ret = regmap_update_bits(lp873->regmap, regulators[id].ctrl2_reg,
LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE,
reg << __ffs(LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE));
FIELD_PREP(LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE, reg));
if (ret) {
dev_err(lp873->dev, "SLEW RATE write failed: %d\n", ret);
return ret;

0 comments on commit 2601b6f

Please sign in to comment.