projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5319aaa
)
regulator: lp873x: Use bitfield helpers
author
Geert Uytterhoeven
<geert+renesas@glider.be>
Thu, 15 Feb 2024 13:09:18 +0000
(14:09 +0100)
committer
Mark Brown
<broonie@kernel.org>
Thu, 15 Feb 2024 13:41:11 +0000
(13:41 +0000)
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>
drivers/regulator/lp873x-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/lp873x-regulator.c
b/drivers/regulator/lp873x-regulator.c
index 8dfdd1db20709e18f1b20dda88f67a8d8e0560e0..84a134cfcd9c98d70a7dc95ecd6622502b6d90ea 100644
(file)
--- a/
drivers/regulator/lp873x-regulator.c
+++ b/
drivers/regulator/lp873x-regulator.c
@@
-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;