pwm: imx27: Fix rounding behavior
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 16 Apr 2020 08:02:45 +0000 (10:02 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Tue, 2 Jun 2020 13:50:52 +0000 (15:50 +0200)
commitaef1a3799b5cb3ba4841f6034497b179646ccc70
tree144592a7fec04b95bedbe61ab9dc9938b4134ef6
parentcad0f2960675261584c14e8f0026cd67c60f4864
pwm: imx27: Fix rounding behavior

To not trigger the warnings provided by CONFIG_PWM_DEBUG

 - use up-rounding in .get_state()
 - don't divide by the result of a division
 - don't use the rounded counter value for the period length to calculate
   the counter value for the duty cycle

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-imx27.c