Skip to content

Commit

Permalink
pwm: ftm: Correctly track usage count
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Xiubo Li authored and Thierry Reding committed Dec 1, 2014
1 parent 06e4cb6 commit 8e6e765
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/pwm/pwm-fsl-ftm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -316,8 +316,6 @@ static int fsl_counter_clock_enable(struct fsl_pwm_chip *fpc)
return ret;
}

fpc->use_count++;

return 0;
}

Expand Down

0 comments on commit 8e6e765

Please sign in to comment.