pwm: stm32: Use hweight32 in stm32_pwm_detect_channels
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 19 Oct 2023 20:07:02 +0000 (22:07 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 20 Dec 2023 15:04:14 +0000 (16:04 +0100)
commit41fa8f57c0d269243fe3bde2bce71e82c884b9ad
tree0d0ba4423c4523a58e781cfed2c03a726250a000
parentc0504f59ced46b080520c2fc15b2b58d70f9ec83
pwm: stm32: Use hweight32 in stm32_pwm_detect_channels

Use hweight32() to count the CCxE bits in stm32_pwm_detect_channels().
Since the return value is assigned to chip.npwm, change it to unsigned
int as well.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-stm32.c