diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-12-02 19:35:17 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2022-12-06 12:46:10 +0100 |
commit | 85cad49f5ed269ffa0c80081d6506e39fa78456b (patch) | |
tree | 82b5718a0e5bcd6dcaf00e968f548a04b6ee8012 /drivers/pwm/pwm-stm32-lp.c | |
parent | 2c85895bf3d202f6932598b124d0db2be4278999 (diff) | |
download | linux-85cad49f5ed269ffa0c80081d6506e39fa78456b.tar.gz linux-85cad49f5ed269ffa0c80081d6506e39fa78456b.tar.bz2 linux-85cad49f5ed269ffa0c80081d6506e39fa78456b.zip |
pwm: stm32-lp: Use regmap_clear_bits and regmap_set_bits where applicable
Found using coccinelle and the following semantic patch:
@@
expression map, reg, bits;
@@
- regmap_update_bits(map, reg, bits, bits)
+ regmap_set_bits(map, reg, bits)
@@
expression map, reg, bits;
@@
- regmap_update_bits(map, reg, bits, 0)
+ regmap_clear_bits(map, reg, bits)
Tested-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20221115111347.3705732-5-u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-stm32-lp.c')
-rw-r--r-- | drivers/pwm/pwm-stm32-lp.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c index 3115abb3f52a..212bdc7d51ee 100644 --- a/drivers/pwm/pwm-stm32-lp.c +++ b/drivers/pwm/pwm-stm32-lp.c @@ -140,9 +140,8 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip, struct pwm_device *pwm, if (reenable) { /* Start LP timer in continuous mode */ - ret = regmap_update_bits(priv->regmap, STM32_LPTIM_CR, - STM32_LPTIM_CNTSTRT, - STM32_LPTIM_CNTSTRT); + ret = regmap_set_bits(priv->regmap, STM32_LPTIM_CR, + STM32_LPTIM_CNTSTRT); if (ret) { regmap_write(priv->regmap, STM32_LPTIM_CR, 0); goto err; |