Message ID | 20221115111347.3705732-1-u.kleine-koenig@pengutronix.de |
---|---|
Headers | show |
Series | pwm: Use regmap_clear_bits and regmap_set_bits where applicable | expand |
Hello, On Tue, Nov 15, 2022 at 12:13:42PM +0100, Uwe Kleine-König wrote: > I recently learned a bit of coccinelle and triggered by Paul Cercueil's > patch that replaces regmap_update_bits() by regmap_set_bits() and > regmap_clear_bits() where applicable in the jz4740 pwm driver[1] I > created a cocci patch for such calls. Pointing to this series I asked broonie in irc if a conversion like that would be suitable to do in the complete tree. He objected that doing that mechanically is probably wrong. His explicit concern was that a call to regmap_clear_bits() (or regmap_set_bits()) in a series of regmap_update_bits() is more disturbing than helpful. So I looked at the remaining calls to regmap_update_bits() in the drivers I converted in this series: - pwm-fsl-ftm There are two calls left that set bits in a mask (these should stay as they are) and one: reg_polarity = 0; if (newstate->polarity == PWM_POLARITY_INVERSED) reg_polarity = BIT(pwm->hwpwm); regmap_update_bits(fpc->regmap, FTM_POL, BIT(pwm->hwpwm), reg_polarity); which could benefit from a conversion (though I expect that to be controversial). The converted calls are all independent of the remaining regmap_update_bits(). - pwm-img No regmap_update_bits() calls left. - pwm-iqs620a There is one call left that does: return regmap_update_bits(iqs62x->regmap, IQS620_PWR_SETTINGS, IQS620_PWR_SETTINGS_PWM_OUT, 0xff); I think this is a bug because IQS620_PWR_SETTINGS_PWM_OUT is only 0xf. - pwm-stm32-lp No regmap_update_bits() calls left. - pwm-stm32 There are several calls left, some of them also near converted calls. My personal opinion is, that the conversion is fine anyhow. Best regards Uwe