diff options
author | Paul Fertser <fercerpav@gmail.com> | 2009-10-17 05:09:55 +0400 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2009-10-17 05:09:55 +0400 |
commit | 464aed729288801b5acb339c1025494c5c12407f (patch) | |
tree | c66a0b6e42c3f08533a7cd72318f24ed01545a33 | |
parent | adb98df68b6e6367ca1e39fc8df3ce32efbe1ae2 (diff) |
Fix pcf50606-regulator drvdata usage
Ported from 01f61025cee418405880d653f33ce179873a3610
-rw-r--r-- | drivers/mfd/pcf50606-core.c | 1 | ||||
-rw-r--r-- | drivers/regulator/pcf50606-regulator.c | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mfd/pcf50606-core.c b/drivers/mfd/pcf50606-core.c index f886893929d..71c56a8b098 100644 --- a/drivers/mfd/pcf50606-core.c +++ b/drivers/mfd/pcf50606-core.c @@ -599,7 +599,6 @@ static int pcf50606_probe(struct i2c_client *client, pdev->dev.parent = pcf->dev; platform_device_add_data(pdev, &pdata->reg_init_data[i], sizeof(pdata->reg_init_data[i])); - pdev->dev.driver_data = pcf; pcf->regulator_pdev[i] = pdev; platform_device_add(pdev); diff --git a/drivers/regulator/pcf50606-regulator.c b/drivers/regulator/pcf50606-regulator.c index 58d020ef93c..667614c06f4 100644 --- a/drivers/regulator/pcf50606-regulator.c +++ b/drivers/regulator/pcf50606-regulator.c @@ -333,13 +333,15 @@ static int __devinit pcf50606_regulator_probe(struct platform_device *pdev) struct pcf50606 *pcf; /* Already set by core driver */ - pcf = platform_get_drvdata(pdev); + pcf = dev_to_pcf50606(pdev->dev.parent); rdev = regulator_register(®ulators[pdev->id], &pdev->dev, pdev->dev.platform_data, pcf); if (IS_ERR(rdev)) return PTR_ERR(rdev); + platform_set_drvdata(pdev, rdev); + if (pcf->pdata->regulator_registered) pcf->pdata->regulator_registered(pcf, pdev->id); @@ -350,6 +352,7 @@ static int __devexit pcf50606_regulator_remove(struct platform_device *pdev) { struct regulator_dev *rdev = platform_get_drvdata(pdev); + platform_set_drvdata(pdev, NULL); regulator_unregister(rdev); return 0; |