From 1f5acf90b02785901ad11ca0eed4d251d48d339b Mon Sep 17 00:00:00 2001
From: Xiubo Li
Date: Tue, 14 Oct 2014 15:32:00 +0800
Subject: pwm: ftm: fix one bug of wrong counting the use counter.
No matter what times the FTM pwm is enabled, the use_count will
always be one.
Signed-off-by: Xiubo Li
---
upstream link: http://patchwork.ozlabs.org/patch/399746/
it is under discussion.
Change-Id: I6f139f1b3fd5dd8f3a4fda729c348aaab9bf66bd
Reviewed-on: http://git.am.freescale.net:8181/21348
Tested-by: Review Code-CDREVIEW
Reviewed-by: Dongsheng Wang
Reviewed-by: Zhengxiong Jin
diff --git a/drivers/pwm/pwm-fsl-ftm.c b/drivers/pwm/pwm-fsl-ftm.c
index 0f2cc7e..1150598 100644
--- a/drivers/pwm/pwm-fsl-ftm.c
+++ b/drivers/pwm/pwm-fsl-ftm.c
@@ -299,7 +299,7 @@ static int fsl_counter_clock_enable(struct fsl_pwm_chip *fpc)
{
int ret;
- if (fpc->use_count != 0)
+ if (fpc->use_count++ != 0)
return 0;
/* select counter clock source */
@@ -316,8 +316,6 @@ static int fsl_counter_clock_enable(struct fsl_pwm_chip *fpc)
return ret;
}
- fpc->use_count++;
-
return 0;
}
--
cgit v0.10.2