]> git.karo-electronics.de Git - linux-beck.git/commitdiff
pwm: ftm: Correctly track usage count
authorXiubo Li <Li.Xiubo@freescale.com>
Wed, 15 Oct 2014 05:21:33 +0000 (13:21 +0800)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 1 Dec 2014 09:43:45 +0000 (10:43 +0100)
No matter how many times the FTM PWM is enabled, the use_count will
always be one.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-fsl-ftm.c

index 0f2cc7ef77848d3cec24ad9e4e6e428bbad7f318..1150598b7532b7971e3ada73b0320dd892fba966 100644 (file)
@@ -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;
 }