Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333103
b: refs/heads/master
c: e551fad
h: refs/heads/master
i:
  333101: 3935052
  333099: 4aa6e81
  333095: 50b6d34
  333087: 06eab1b
v: v3
  • Loading branch information
Thierry Reding committed Oct 5, 2012
1 parent c17eb08 commit 6362db1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 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: dde9959b8d5b791a3e06e3c44f2d9ba0ec5143f0
refs/heads/master: e551fadef3650c34137e90f17963ca613b8f8610
23 changes: 6 additions & 17 deletions trunk/arch/unicore32/kernel/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ static inline void __add_pwm(struct pwm_device *pwm)
mutex_unlock(&pwm_lock);
}

static struct pwm_device *pwm_probe(struct platform_device *pdev,
unsigned int pwm_id, struct pwm_device *parent_pwm)
static int __devinit pwm_probe(struct platform_device *pdev)
{
struct pwm_device *pwm;
struct resource *r;
Expand All @@ -166,7 +165,7 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,
pwm = kzalloc(sizeof(struct pwm_device), GFP_KERNEL);
if (pwm == NULL) {
dev_err(&pdev->dev, "failed to allocate memory\n");
return ERR_PTR(-ENOMEM);
return -ENOMEM;
}

pwm->clk = clk_get(NULL, "OST_CLK");
Expand All @@ -177,7 +176,7 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,
pwm->clk_enabled = 0;

pwm->use_count = 0;
pwm->pwm_id = pwm_id;
pwm->pwm_id = pdev->id;
pwm->pdev = pdev;

r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
Expand All @@ -203,25 +202,15 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,

__add_pwm(pwm);
platform_set_drvdata(pdev, pwm);
return pwm;
return 0;

err_release_mem:
release_mem_region(r->start, resource_size(r));
err_free_clk:
clk_put(pwm->clk);
err_free:
kfree(pwm);
return ERR_PTR(ret);
}

static int __devinit puv3_pwm_probe(struct platform_device *pdev)
{
struct pwm_device *pwm = pwm_probe(pdev, pdev->id, NULL);

if (IS_ERR(pwm))
return PTR_ERR(pwm);

return 0;
return ret;
}

static int __devexit pwm_remove(struct platform_device *pdev)
Expand Down Expand Up @@ -251,7 +240,7 @@ static struct platform_driver puv3_pwm_driver = {
.driver = {
.name = "PKUnity-v3-PWM",
},
.probe = puv3_pwm_probe,
.probe = pwm_probe,
.remove = __devexit_p(pwm_remove),
};
module_platform_driver(puv3_pwm_driver);
Expand Down

0 comments on commit 6362db1

Please sign in to comment.