We should minus one after calculating the counter input clock's
prescaler.

Signed-off-by: Xiubo Li <li.xi...@freescale.com>
Signed-off-by: Jingchang Lu <jingchang...@freescale.com>
---
 drivers/clocksource/fsl_ftm_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/fsl_ftm_timer.c 
b/drivers/clocksource/fsl_ftm_timer.c
index f70fcf2..974890e 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -311,7 +311,7 @@ static int __init ftm_calc_closest_round_cyc(unsigned long 
freq)
                                                HZ * (1 << priv->ps++));
        } while (priv->periodic_cyc > 0xFFFF);
 
-       if (priv->ps > FTM_PS_MAX) {
+       if (--priv->ps > FTM_PS_MAX) {
                pr_err("ftm: the prescaler is %lu > %d\n",
                                priv->ps, FTM_PS_MAX);
                return -EINVAL;
-- 
1.8.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to