pwm: stm32: Replace write_ccrx with regmap_write
authorPhilipp Zabel <p.zabel@pengutronix.de>
Thu, 19 Oct 2023 20:07:00 +0000 (22:07 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 20 Dec 2023 15:04:14 +0000 (16:04 +0100)
commite495f47274a145dd802748fed66608f46d9ae11d
treef0ab2902df53566d4a9bfb2850249adce32ce5b8
parent7ee2273197f1c1755ebdad8716eab50689401aff
pwm: stm32: Replace write_ccrx with regmap_write

The TIM_CCR1...4 registers are consecutive, so replace the switch
case with a simple calculation. Since ch is known to be in the 0...3
range (it is set to hwpwm < npwm <= 4), drop the unnecessary error
handling. The return value was not checked anyway. What remains does
not warrant keeping the write_ccrx() function around, so instead call
regmap_write() directly at the singular call site.

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