Skip to content

Commit

Permalink
pwm: imx: Remove enabled field from struct imx_chip
Browse files Browse the repository at this point in the history
We can test PWMF_ENABLED bit to know if pwm is enabled or not.
Thus remove enabled field from struct imx_chip.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
  • Loading branch information
Axel Lin authored and Thierry Reding committed Apr 2, 2013
1 parent d5714e8 commit 72da70e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/pwm/pwm-imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ struct imx_chip {
struct clk *clk_per;
struct clk *clk_ipg;

int enabled;
void __iomem *mmio_base;

struct pwm_chip chip;
Expand Down Expand Up @@ -135,7 +134,7 @@ static int imx_pwm_config_v2(struct pwm_chip *chip,
MX3_PWMCR_DOZEEN | MX3_PWMCR_WAITEN |
MX3_PWMCR_DBGEN | MX3_PWMCR_CLKSRC_IPG_HIGH;

if (imx->enabled)
if (test_bit(PWMF_ENABLED, &pwm->flags))
cr |= MX3_PWMCR_EN;

writel(cr, imx->mmio_base + MX3_PWMCR);
Expand Down Expand Up @@ -186,8 +185,6 @@ static int imx_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)

imx->set_enable(chip, true);

imx->enabled = 1;

return 0;
}

Expand All @@ -198,7 +195,6 @@ static void imx_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
imx->set_enable(chip, false);

clk_disable_unprepare(imx->clk_per);
imx->enabled = 0;
}

static struct pwm_ops imx_pwm_ops = {
Expand Down

0 comments on commit 72da70e

Please sign in to comment.