提交 71a35d75 编写于 作者: R roelkluin 提交者: Russell King

[ARM] 5303/1: period_cycles should be greater than 1

If period_cycles is 0, prescale becomes silly.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 e4d2a598
......@@ -60,7 +60,7 @@ int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns)
do_div(c, 1000000000);
period_cycles = c;
if (period_cycles < 0)
if (period_cycles < 1)
period_cycles = 1;
prescale = (period_cycles - 1) / 1024;
pv = period_cycles / (prescale + 1) - 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册