From: Vasily Khoruzhick Date: Wed, 17 Oct 2018 04:56:33 +0000 (-0700) Subject: pwm: sunxi: fix off-by-one that prevented PWM to use prescaler bypass X-Git-Tag: v2018.11-rc3~1^2~11 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a877d4b1aef70bbae556e156e6802b7d917546ab;p=oweals%2Fu-boot.git pwm: sunxi: fix off-by-one that prevented PWM to use prescaler bypass Fix off-by-one that prevented PWM driver to use prescaler bypass. Without this change prescaler is always enabled. Signed-off-by: Vasily Khoruzhick Acked-by: Maxime Ripard Reviewed-by: Jagan Teki --- diff --git a/drivers/pwm/sunxi_pwm.c b/drivers/pwm/sunxi_pwm.c index 3c7dffdd90..baee503730 100644 --- a/drivers/pwm/sunxi_pwm.c +++ b/drivers/pwm/sunxi_pwm.c @@ -74,7 +74,7 @@ static int sunxi_pwm_set_config(struct udevice *dev, uint channel, debug("%s: period_ns=%u, duty_ns=%u\n", __func__, period_ns, duty_ns); - for (prescaler = 0; prescaler < SUNXI_PWM_CTRL_PRESCALE0_MASK; + for (prescaler = 0; prescaler <= SUNXI_PWM_CTRL_PRESCALE0_MASK; prescaler++) { if (!prescaler_table[prescaler]) continue;