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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:38 +0000 (15:35 -0800)
commit5eb8da9b3ef7356b3526939ce4fafe5fedcc9e79
treea530e0fceeacec37cf68c06476b0aa506cb5bcfb
parentf1da0b7a092a05dce24be2f22aae0e7a0578feb4
pwm: stm32: Use hweight32 in stm32_pwm_detect_channels

[ Upstream commit 41fa8f57c0d269243fe3bde2bce71e82c884b9ad ]

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>
Stable-dep-of: 19f1016ea960 ("pwm: stm32: Fix enable count for clk in .probe()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-stm32.c