From 71a35d75661271d20ff0098817070f6545e90cbe Mon Sep 17 00:00:00 2001 From: roelkluin Date: Tue, 14 Oct 2008 21:28:51 +0100 Subject: [PATCH] [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 --- arch/arm/mach-pxa/pwm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-pxa/pwm.c b/arch/arm/mach-pxa/pwm.c index 316cd986da5c..74e2ead8cee8 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; -- 2.20.1