From: Xiubo Li
Date: Wed, 15 Oct 2014 05:21:33 +0000 (+0800)
Subject: pwm: ftm: Correctly track usage count
X-Git-Tag: firefly_0821_release~176^2~2646^2~3
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8e6e76510287d1a08c7c36e8e076b1314f59d9c4;p=firefly-linux-kernel-4.4.55.git
pwm: ftm: Correctly track usage count
No matter how many times the FTM PWM is enabled, the use_count will
always be one.
Signed-off-by: Xiubo Li
Signed-off-by: Thierry Reding
---
diff --git a/drivers/pwm/pwm-fsl-ftm.c b/drivers/pwm/pwm-fsl-ftm.c
index 0f2cc7ef7784..1150598b7532 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;
}