Explorar o código

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 <Li.Xiubo@freescale.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Xiubo Li %!s(int64=11) %!d(string=hai) anos
pai
achega
8e6e765102
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      drivers/pwm/pwm-fsl-ftm.c

+ 1 - 3
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;
 }