pwm: stm32: Don't open-code TIM_CCER_CCxE()
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Sat, 5 Apr 2025 09:27:14 +0000 (11:27 +0200)
committerUwe Kleine-König <ukleinek@kernel.org>
Mon, 14 Apr 2025 06:03:16 +0000 (08:03 +0200)
Instead of manually calculating the offset of the channels CCxE bit,
make use of the TIM_CCER_CCxE macro.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/7803f63b1310ddbd706f51f2f42d30b6dd786b03.1743844730.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/pwm-stm32.c

index ec2c05c9ee7a677c8df1145899acfd236a8076a9..c6625f51a19912e5e8622a171e745d652a37da1e 100644 (file)
@@ -88,7 +88,7 @@ static int stm32_pwm_round_waveform_tohw(struct pwm_chip *chip,
 
        rate = clk_get_rate(priv->clk);
 
-       if (active_channels(priv) & ~(1 << ch * 4)) {
+       if (active_channels(priv) & ~TIM_CCER_CCxE(ch + 1)) {
                u64 arr;
 
                /*