Skip to content

Commit

Permalink
[ARM] 5303/1: period_cycles should be greater than 1
Browse files Browse the repository at this point in the history
If period_cycles is 0, prescale becomes silly.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
roelkluin authored and Russell King committed Oct 17, 2008
1 parent e4d2a59 commit 71a35d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-pxa/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 71a35d7

Please sign in to comment.