Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

regulator: lp873x: Use bitfield helpers

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>

authored by

Geert Uytterhoeven and committed by
Mark Brown
2601b6fb 5319aaa9

+2 -1
+2 -1
drivers/regulator/lp873x-regulator.c
··· 5 5 * Copyright (C) 2016 Texas Instruments Incorporated - https://www.ti.com/ 6 6 */ 7 7 8 + #include <linux/bitfield.h> 8 9 #include <linux/module.h> 9 10 #include <linux/platform_device.h> 10 11 #include <linux/regmap.h> ··· 94 93 95 94 ret = regmap_update_bits(lp873->regmap, regulators[id].ctrl2_reg, 96 95 LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE, 97 - reg << __ffs(LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE)); 96 + FIELD_PREP(LP873X_BUCK0_CTRL_2_BUCK0_SLEW_RATE, reg)); 98 97 if (ret) { 99 98 dev_err(lp873->dev, "SLEW RATE write failed: %d\n", ret); 100 99 return ret;