Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373594
b: refs/heads/master
c: b014a30
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Thierry Reding committed Apr 2, 2013
1 parent 41ea874 commit c8b6152
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 72da70e77f885ec9a79af9c13ff1c79b6136b75f
refs/heads/master: b014a30c5991e67aa90b6ff9bd4ec16435bbcefd
16 changes: 2 additions & 14 deletions trunk/drivers/pwm/pwm-pxa.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ struct pxa_pwm_chip {
struct device *dev;

struct clk *clk;
int clk_enabled;
void __iomem *mmio_base;
};

Expand Down Expand Up @@ -108,24 +107,15 @@ static int pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
static int pxa_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
{
struct pxa_pwm_chip *pc = to_pxa_pwm_chip(chip);
int rc = 0;

if (!pc->clk_enabled) {
rc = clk_prepare_enable(pc->clk);
if (!rc)
pc->clk_enabled++;
}
return rc;
return clk_prepare_enable(pc->clk);
}

static void pxa_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
{
struct pxa_pwm_chip *pc = to_pxa_pwm_chip(chip);

if (pc->clk_enabled) {
clk_disable_unprepare(pc->clk);
pc->clk_enabled--;
}
clk_disable_unprepare(pc->clk);
}

static struct pwm_ops pxa_pwm_ops = {
Expand All @@ -152,8 +142,6 @@ static int pwm_probe(struct platform_device *pdev)
if (IS_ERR(pwm->clk))
return PTR_ERR(pwm->clk);

pwm->clk_enabled = 0;

pwm->chip.dev = &pdev->dev;
pwm->chip.ops = &pxa_pwm_ops;
pwm->chip.base = -1;
Expand Down

0 comments on commit c8b6152

Please sign in to comment.