diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2022-12-02 19:35:15 +0100 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2022-12-06 12:46:09 +0100 |
commit | 50f2151034b65125b6cce6b385ce8b74556e45f6 (patch) | |
tree | ee70b39cb73e5d5d5ed21db0cdb8d1fcb5108ff3 /drivers/pwm | |
parent | c637d87a7d96bd04674515b879b500f66361b74c (diff) | |
download | lwn-50f2151034b65125b6cce6b385ce8b74556e45f6.tar.gz lwn-50f2151034b65125b6cce6b385ce8b74556e45f6.zip |
pwm: img: 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)
Link: https://lore.kernel.org/r/20221115111347.3705732-3-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')
-rw-r--r-- | drivers/pwm/pwm-img.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c index 0fccf061ab95..89362afe3c91 100644 --- a/drivers/pwm/pwm-img.c +++ b/drivers/pwm/pwm-img.c @@ -161,9 +161,9 @@ static int img_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) val |= BIT(pwm->hwpwm); img_pwm_writel(imgchip, PWM_CTRL_CFG, val); - regmap_update_bits(imgchip->periph_regs, PERIP_PWM_PDM_CONTROL, - PERIP_PWM_PDM_CONTROL_CH_MASK << - PERIP_PWM_PDM_CONTROL_CH_SHIFT(pwm->hwpwm), 0); + regmap_clear_bits(imgchip->periph_regs, PERIP_PWM_PDM_CONTROL, + PERIP_PWM_PDM_CONTROL_CH_MASK << + PERIP_PWM_PDM_CONTROL_CH_SHIFT(pwm->hwpwm)); return 0; } @@ -397,11 +397,10 @@ static int img_pwm_resume(struct device *dev) for (i = 0; i < imgchip->chip.npwm; i++) if (imgchip->suspend_ctrl_cfg & BIT(i)) - regmap_update_bits(imgchip->periph_regs, - PERIP_PWM_PDM_CONTROL, - PERIP_PWM_PDM_CONTROL_CH_MASK << - PERIP_PWM_PDM_CONTROL_CH_SHIFT(i), - 0); + regmap_clear_bits(imgchip->periph_regs, + PERIP_PWM_PDM_CONTROL, + PERIP_PWM_PDM_CONTROL_CH_MASK << + PERIP_PWM_PDM_CONTROL_CH_SHIFT(i)); if (pm_runtime_status_suspended(dev)) img_pwm_runtime_suspend(dev); |