Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319213
b: refs/heads/master
c: 22d260b
h: refs/heads/master
i:
  319211: 3874e20
v: v3
  • Loading branch information
Shawn Guo authored and Thierry Reding committed Jul 23, 2012
1 parent e524bf9 commit f3f3e2e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 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: 01bf32e94968fd13804062859cfd935efebc11e9
refs/heads/master: 22d260bd88452ae81c80514810434d4cc98b7978
24 changes: 8 additions & 16 deletions trunk/drivers/pwm/pwm-mxs.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,35 +129,35 @@ static int mxs_pwm_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
struct mxs_pwm_chip *mxs;
struct resource *res;
int ret;

mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL);
if (!mxs)
return -ENOMEM;

mxs->base = of_iomap(np, 0);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
mxs->base = devm_request_and_ioremap(&pdev->dev, res);
if (!mxs->base)
return -EADDRNOTAVAIL;

mxs->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(mxs->clk)) {
ret = PTR_ERR(mxs->clk);
goto iounmap;
}
mxs->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(mxs->clk))
return PTR_ERR(mxs->clk);

mxs->chip.dev = &pdev->dev;
mxs->chip.ops = &mxs_pwm_ops;
mxs->chip.base = -1;
ret = of_property_read_u32(np, "fsl,pwm-number", &mxs->chip.npwm);
if (ret < 0) {
dev_err(&pdev->dev, "failed to get pwm number: %d\n", ret);
goto clk_put;
return ret;
}

ret = pwmchip_add(&mxs->chip);
if (ret < 0) {
dev_err(&pdev->dev, "failed to add pwm chip %d\n", ret);
goto clk_put;
return ret;
}

mxs->dev = &pdev->dev;
Expand All @@ -166,21 +166,13 @@ static int mxs_pwm_probe(struct platform_device *pdev)
stmp_reset_block(mxs->base);

return 0;

clk_put:
clk_put(mxs->clk);
iounmap:
iounmap(mxs->base);
return ret;
}

static int __devexit mxs_pwm_remove(struct platform_device *pdev)
{
struct mxs_pwm_chip *mxs = platform_get_drvdata(pdev);

pwmchip_remove(&mxs->chip);
clk_put(mxs->clk);
iounmap(mxs->base);

return 0;
}
Expand Down

0 comments on commit f3f3e2e

Please sign in to comment.