Uwe Kleine-König d59bb70350 pwm: stm32: Refuse too small period requests
commit c45fcf46ca2368dafe7e5c513a711a6f0f974308 upstream.

If period_ns is small, prd might well become 0. Catch that case because
otherwise with

	regmap_write(priv->regmap, TIM_ARR, prd - 1);

a few lines down quite a big period is configured.

Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
Cc: stable@vger.kernel.org
Reviewed-by: Trevor Gamblin <tgamblin@baylibre.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/b86f62f099983646f97eeb6bfc0117bb2d0c340d.1718979150.git.u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-07-05 09:08:32 +02:00
..
2023-09-23 10:59:52 +02:00
2024-04-13 12:51:26 +02:00
2024-07-05 09:08:28 +02:00
2023-11-20 10:30:12 +01:00
2024-02-23 08:25:15 +01:00
2024-02-23 08:24:54 +01:00
2024-07-05 09:08:30 +02:00
2024-01-25 14:34:21 -08:00
2023-07-27 08:37:19 +02:00