From: roelkluin Date: Tue, 14 Oct 2008 20:28:51 +0000 (+0100) Subject: [ARM] 5303/1: period_cycles should be greater than 1 X-Git-Tag: v2.6.28-rc1~63^2~9 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=71a35d75661271d20ff0098817070f6545e90cbe;p=linux-2.6-omap-h63xx.git [ARM] 5303/1: period_cycles should be greater than 1 If period_cycles is 0, prescale becomes silly. Signed-off-by: Roel Kluin Signed-off-by: Russell King --- diff --git a/arch/arm/mach-pxa/pwm.c b/arch/arm/mach-pxa/pwm.c index 316cd986da5..74e2ead8cee 100644 --- a/arch/arm/mach-pxa/pwm.c +++ b/arch/arm/mach-pxa/pwm.c @@ -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;