Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185680
b: refs/heads/master
c: 1ad02bb
h: refs/heads/master
v: v3
  • Loading branch information
Dmitry Torokhov authored and Liam Girdwood committed Mar 3, 2010
1 parent f132459 commit 86934e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 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: 598b3578ab9ee8e3eef322128485719668d8b93b
refs/heads/master: 1ad02bbce64e5226b0582af85df4e481e2f6b7b9
7 changes: 5 additions & 2 deletions trunk/drivers/regulator/wm8400-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,25 @@ static struct regulator_desc regulators[] = {

static int __devinit wm8400_regulator_probe(struct platform_device *pdev)
{
struct wm8400 *wm8400 = container_of(pdev, struct wm8400, regulators[pdev->id]);
struct regulator_dev *rdev;

rdev = regulator_register(&regulators[pdev->id], &pdev->dev,
pdev->dev.platform_data, dev_get_drvdata(&pdev->dev));
pdev->dev.platform_data, wm8400);

if (IS_ERR(rdev))
return PTR_ERR(rdev);

platform_set_drvdata(pdev, rdev);

return 0;
}

static int __devexit wm8400_regulator_remove(struct platform_device *pdev)
{
struct regulator_dev *rdev = platform_get_drvdata(pdev);

platform_set_drvdata(pdev, NULL);
regulator_unregister(rdev);

return 0;
Expand Down Expand Up @@ -370,7 +374,6 @@ int wm8400_register_regulator(struct device *dev, int reg,
wm8400->regulators[reg].id = reg;
wm8400->regulators[reg].dev.parent = dev;
wm8400->regulators[reg].dev.platform_data = initdata;
dev_set_drvdata(&wm8400->regulators[reg].dev, wm8400);

return platform_device_register(&wm8400->regulators[reg]);
}
Expand Down

0 comments on commit 86934e2

Please sign in to comment.