Commit a7c98ce2 authored by Samuel Ortiz's avatar Samuel Ortiz

mfd: Use mfd cell platform_data for tps6105x cells platform bits

With the addition of a platform device mfd_cell pointer, MFD drivers
can go back to passing platform data back to their sub drivers.
This allows for an mfd_cell->mfd_data removal and thus keep the
sub drivers MFD agnostic. This is mostly needed for non MFD aware
sub drivers.

Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent a4579ad2
...@@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client, ...@@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client,
/* Set up and register the platform devices. */ /* Set up and register the platform devices. */
for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) { for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) {
/* One state holder for all drivers, this is simple */ /* One state holder for all drivers, this is simple */
tps6105x_cells[i].mfd_data = tps6105x; tps6105x_cells[i].platform_data = tps6105x;
tps6105x_cells[i].pdata_size = sizeof(*tps6105x);
} }
ret = mfd_add_devices(&client->dev, 0, tps6105x_cells, ret = mfd_add_devices(&client->dev, 0, tps6105x_cells,
......
...@@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = { ...@@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = {
*/ */
static int __devinit tps6105x_regulator_probe(struct platform_device *pdev) static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
{ {
struct tps6105x *tps6105x = mfd_get_data(pdev); struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
struct tps6105x_platform_data *pdata = tps6105x->pdata; struct tps6105x_platform_data *pdata = tps6105x->pdata;
int ret; int ret;
...@@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev) ...@@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
static int __devexit tps6105x_regulator_remove(struct platform_device *pdev) static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
{ {
struct tps6105x *tps6105x = platform_get_drvdata(pdev); struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
regulator_unregister(tps6105x->regulator); regulator_unregister(tps6105x->regulator);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment