diff options
author | Mark Brown <broonie@linaro.org> | 2013-09-01 08:50:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-01 08:50:16 -0400 |
commit | 6979380d85fd9e1ff701021206b315fcd66b510e (patch) | |
tree | 8f230b8404cafdcfafba44bf97210c94ee963f92 /drivers/regulator | |
parent | 3aba952706c2f1e5f05987be0cda716ecf2b5d55 (diff) | |
parent | d6c7e1139591b9ba7c4ad9c5eec748f0a68ad212 (diff) |
Merge remote-tracking branch 'regulator/topic/max8660' into regulator-next
Diffstat (limited to 'drivers/regulator')
38 files changed, 140 insertions, 52 deletions
diff --git a/drivers/regulator/88pm800.c b/drivers/regulator/88pm800.c index b30f5ce659d1..3459f60dcfd1 100644 --- a/drivers/regulator/88pm800.c +++ b/drivers/regulator/88pm800.c | |||
@@ -283,7 +283,7 @@ static int pm800_regulator_dt_init(struct platform_device *pdev) | |||
283 | static int pm800_regulator_probe(struct platform_device *pdev) | 283 | static int pm800_regulator_probe(struct platform_device *pdev) |
284 | { | 284 | { |
285 | struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); | 285 | struct pm80x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
286 | struct pm80x_platform_data *pdata = pdev->dev.parent->platform_data; | 286 | struct pm80x_platform_data *pdata = dev_get_platdata(pdev->dev.parent); |
287 | struct pm800_regulators *pm800_data; | 287 | struct pm800_regulators *pm800_data; |
288 | struct pm800_regulator_info *info; | 288 | struct pm800_regulator_info *info; |
289 | struct regulator_config config = { }; | 289 | struct regulator_config config = { }; |
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 8a7cb1f43046..70230974468c 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c | |||
@@ -346,7 +346,7 @@ static int pm8607_regulator_probe(struct platform_device *pdev) | |||
346 | { | 346 | { |
347 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | 347 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
348 | struct pm8607_regulator_info *info = NULL; | 348 | struct pm8607_regulator_info *info = NULL; |
349 | struct regulator_init_data *pdata = pdev->dev.platform_data; | 349 | struct regulator_init_data *pdata = dev_get_platdata(&pdev->dev); |
350 | struct regulator_config config = { }; | 350 | struct regulator_config config = { }; |
351 | struct resource *res; | 351 | struct resource *res; |
352 | int i; | 352 | int i; |
diff --git a/drivers/regulator/aat2870-regulator.c b/drivers/regulator/aat2870-regulator.c index 8b5876356db9..881159dfcb5e 100644 --- a/drivers/regulator/aat2870-regulator.c +++ b/drivers/regulator/aat2870-regulator.c | |||
@@ -174,7 +174,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev) | |||
174 | 174 | ||
175 | config.dev = &pdev->dev; | 175 | config.dev = &pdev->dev; |
176 | config.driver_data = ri; | 176 | config.driver_data = ri; |
177 | config.init_data = pdev->dev.platform_data; | 177 | config.init_data = dev_get_platdata(&pdev->dev); |
178 | 178 | ||
179 | rdev = regulator_register(&ri->desc, &config); | 179 | rdev = regulator_register(&ri->desc, &config); |
180 | if (IS_ERR(rdev)) { | 180 | if (IS_ERR(rdev)) { |
diff --git a/drivers/regulator/ab3100.c b/drivers/regulator/ab3100.c index 3be9e46594a1..7d5eaa874b2d 100644 --- a/drivers/regulator/ab3100.c +++ b/drivers/regulator/ab3100.c | |||
@@ -660,7 +660,7 @@ ab3100_regulator_of_probe(struct platform_device *pdev, struct device_node *np) | |||
660 | 660 | ||
661 | static int ab3100_regulators_probe(struct platform_device *pdev) | 661 | static int ab3100_regulators_probe(struct platform_device *pdev) |
662 | { | 662 | { |
663 | struct ab3100_platform_data *plfdata = pdev->dev.platform_data; | 663 | struct ab3100_platform_data *plfdata = dev_get_platdata(&pdev->dev); |
664 | struct device_node *np = pdev->dev.of_node; | 664 | struct device_node *np = pdev->dev.of_node; |
665 | int err = 0; | 665 | int err = 0; |
666 | u8 data; | 666 | u8 data; |
diff --git a/drivers/regulator/ad5398.c b/drivers/regulator/ad5398.c index 6b981b5faa70..b2b203cb6b2f 100644 --- a/drivers/regulator/ad5398.c +++ b/drivers/regulator/ad5398.c | |||
@@ -214,7 +214,7 @@ MODULE_DEVICE_TABLE(i2c, ad5398_id); | |||
214 | static int ad5398_probe(struct i2c_client *client, | 214 | static int ad5398_probe(struct i2c_client *client, |
215 | const struct i2c_device_id *id) | 215 | const struct i2c_device_id *id) |
216 | { | 216 | { |
217 | struct regulator_init_data *init_data = client->dev.platform_data; | 217 | struct regulator_init_data *init_data = dev_get_platdata(&client->dev); |
218 | struct regulator_config config = { }; | 218 | struct regulator_config config = { }; |
219 | struct ad5398_chip_info *chip; | 219 | struct ad5398_chip_info *chip; |
220 | const struct ad5398_current_data_format *df = | 220 | const struct ad5398_current_data_format *df = |
diff --git a/drivers/regulator/da903x.c b/drivers/regulator/da903x.c index 1378a242a3af..f06854cf8cf5 100644 --- a/drivers/regulator/da903x.c +++ b/drivers/regulator/da903x.c | |||
@@ -460,7 +460,7 @@ static int da903x_regulator_probe(struct platform_device *pdev) | |||
460 | ri->desc.ops = &da9030_regulator_ldo1_15_ops; | 460 | ri->desc.ops = &da9030_regulator_ldo1_15_ops; |
461 | 461 | ||
462 | config.dev = &pdev->dev; | 462 | config.dev = &pdev->dev; |
463 | config.init_data = pdev->dev.platform_data; | 463 | config.init_data = dev_get_platdata(&pdev->dev); |
464 | config.driver_data = ri; | 464 | config.driver_data = ri; |
465 | 465 | ||
466 | rdev = regulator_register(&ri->desc, &config); | 466 | rdev = regulator_register(&ri->desc, &config); |
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index 96b569abb46c..1e4d483f6163 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c | |||
@@ -349,7 +349,7 @@ static int da9052_regulator_probe(struct platform_device *pdev) | |||
349 | return -ENOMEM; | 349 | return -ENOMEM; |
350 | 350 | ||
351 | da9052 = dev_get_drvdata(pdev->dev.parent); | 351 | da9052 = dev_get_drvdata(pdev->dev.parent); |
352 | pdata = da9052->dev->platform_data; | 352 | pdata = dev_get_platdata(da9052->dev); |
353 | regulator->da9052 = da9052; | 353 | regulator->da9052 = da9052; |
354 | 354 | ||
355 | regulator->info = find_regulator_info(regulator->da9052->chip_id, | 355 | regulator->info = find_regulator_info(regulator->da9052->chip_id, |
diff --git a/drivers/regulator/da9055-regulator.c b/drivers/regulator/da9055-regulator.c index 30221099d09c..77b53e5a231c 100644 --- a/drivers/regulator/da9055-regulator.c +++ b/drivers/regulator/da9055-regulator.c | |||
@@ -535,7 +535,7 @@ static int da9055_regulator_probe(struct platform_device *pdev) | |||
535 | struct regulator_config config = { }; | 535 | struct regulator_config config = { }; |
536 | struct da9055_regulator *regulator; | 536 | struct da9055_regulator *regulator; |
537 | struct da9055 *da9055 = dev_get_drvdata(pdev->dev.parent); | 537 | struct da9055 *da9055 = dev_get_drvdata(pdev->dev.parent); |
538 | struct da9055_pdata *pdata = da9055->dev->platform_data; | 538 | struct da9055_pdata *pdata = dev_get_platdata(da9055->dev); |
539 | int ret, irq; | 539 | int ret, irq; |
540 | 540 | ||
541 | if (pdata == NULL || pdata->regulators[pdev->id] == NULL) | 541 | if (pdata == NULL || pdata->regulators[pdev->id] == NULL) |
diff --git a/drivers/regulator/fan53555.c b/drivers/regulator/fan53555.c index f0e1ae52bb05..a32b44272a05 100644 --- a/drivers/regulator/fan53555.c +++ b/drivers/regulator/fan53555.c | |||
@@ -237,7 +237,7 @@ static int fan53555_regulator_probe(struct i2c_client *client, | |||
237 | unsigned int val; | 237 | unsigned int val; |
238 | int ret; | 238 | int ret; |
239 | 239 | ||
240 | pdata = client->dev.platform_data; | 240 | pdata = dev_get_platdata(&client->dev); |
241 | if (!pdata || !pdata->regulator) { | 241 | if (!pdata || !pdata->regulator) { |
242 | dev_err(&client->dev, "Platform data not found!\n"); | 242 | dev_err(&client->dev, "Platform data not found!\n"); |
243 | return -ENODEV; | 243 | return -ENODEV; |
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c index e5c03b534fae..7610920014d7 100644 --- a/drivers/regulator/fixed.c +++ b/drivers/regulator/fixed.c | |||
@@ -146,7 +146,7 @@ static int reg_fixed_voltage_probe(struct platform_device *pdev) | |||
146 | if (IS_ERR(config)) | 146 | if (IS_ERR(config)) |
147 | return PTR_ERR(config); | 147 | return PTR_ERR(config); |
148 | } else { | 148 | } else { |
149 | config = pdev->dev.platform_data; | 149 | config = dev_get_platdata(&pdev->dev); |
150 | } | 150 | } |
151 | 151 | ||
152 | if (!config) | 152 | if (!config) |
diff --git a/drivers/regulator/gpio-regulator.c b/drivers/regulator/gpio-regulator.c index 9d39eb4aafa3..98a98ffa7fe0 100644 --- a/drivers/regulator/gpio-regulator.c +++ b/drivers/regulator/gpio-regulator.c | |||
@@ -219,7 +219,7 @@ static struct regulator_ops gpio_regulator_current_ops = { | |||
219 | 219 | ||
220 | static int gpio_regulator_probe(struct platform_device *pdev) | 220 | static int gpio_regulator_probe(struct platform_device *pdev) |
221 | { | 221 | { |
222 | struct gpio_regulator_config *config = pdev->dev.platform_data; | 222 | struct gpio_regulator_config *config = dev_get_platdata(&pdev->dev); |
223 | struct device_node *np = pdev->dev.of_node; | 223 | struct device_node *np = pdev->dev.of_node; |
224 | struct gpio_regulator_data *drvdata; | 224 | struct gpio_regulator_data *drvdata; |
225 | struct regulator_config cfg = { }; | 225 | struct regulator_config cfg = { }; |
diff --git a/drivers/regulator/isl6271a-regulator.c b/drivers/regulator/isl6271a-regulator.c index b99c49b9aff0..88c1a3acf563 100644 --- a/drivers/regulator/isl6271a-regulator.c +++ b/drivers/regulator/isl6271a-regulator.c | |||
@@ -110,7 +110,7 @@ static int isl6271a_probe(struct i2c_client *i2c, | |||
110 | const struct i2c_device_id *id) | 110 | const struct i2c_device_id *id) |
111 | { | 111 | { |
112 | struct regulator_config config = { }; | 112 | struct regulator_config config = { }; |
113 | struct regulator_init_data *init_data = i2c->dev.platform_data; | 113 | struct regulator_init_data *init_data = dev_get_platdata(&i2c->dev); |
114 | struct isl_pmic *pmic; | 114 | struct isl_pmic *pmic; |
115 | int err, i; | 115 | int err, i; |
116 | 116 | ||
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index 3809b4381606..5a4604ee5ea5 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c | |||
@@ -425,7 +425,7 @@ static int lp3971_i2c_probe(struct i2c_client *i2c, | |||
425 | const struct i2c_device_id *id) | 425 | const struct i2c_device_id *id) |
426 | { | 426 | { |
427 | struct lp3971 *lp3971; | 427 | struct lp3971 *lp3971; |
428 | struct lp3971_platform_data *pdata = i2c->dev.platform_data; | 428 | struct lp3971_platform_data *pdata = dev_get_platdata(&i2c->dev); |
429 | int ret; | 429 | int ret; |
430 | u16 val; | 430 | u16 val; |
431 | 431 | ||
diff --git a/drivers/regulator/lp3972.c b/drivers/regulator/lp3972.c index 573024039ca0..093e6f44ff8a 100644 --- a/drivers/regulator/lp3972.c +++ b/drivers/regulator/lp3972.c | |||
@@ -519,7 +519,7 @@ static int lp3972_i2c_probe(struct i2c_client *i2c, | |||
519 | const struct i2c_device_id *id) | 519 | const struct i2c_device_id *id) |
520 | { | 520 | { |
521 | struct lp3972 *lp3972; | 521 | struct lp3972 *lp3972; |
522 | struct lp3972_platform_data *pdata = i2c->dev.platform_data; | 522 | struct lp3972_platform_data *pdata = dev_get_platdata(&i2c->dev); |
523 | int ret; | 523 | int ret; |
524 | u16 val; | 524 | u16 val; |
525 | 525 | ||
diff --git a/drivers/regulator/lp872x.c b/drivers/regulator/lp872x.c index 1018fb2020a9..2b84b727a3c4 100644 --- a/drivers/regulator/lp872x.c +++ b/drivers/regulator/lp872x.c | |||
@@ -962,7 +962,7 @@ static int lp872x_probe(struct i2c_client *cl, const struct i2c_device_id *id) | |||
962 | } | 962 | } |
963 | 963 | ||
964 | lp->dev = &cl->dev; | 964 | lp->dev = &cl->dev; |
965 | lp->pdata = cl->dev.platform_data; | 965 | lp->pdata = dev_get_platdata(&cl->dev); |
966 | lp->chipid = id->driver_data; | 966 | lp->chipid = id->driver_data; |
967 | lp->num_regulators = num_regulators; | 967 | lp->num_regulators = num_regulators; |
968 | i2c_set_clientdata(cl, lp); | 968 | i2c_set_clientdata(cl, lp); |
diff --git a/drivers/regulator/lp8755.c b/drivers/regulator/lp8755.c index b37ef303e29f..785a25e9a437 100644 --- a/drivers/regulator/lp8755.c +++ b/drivers/regulator/lp8755.c | |||
@@ -450,7 +450,7 @@ static int lp8755_probe(struct i2c_client *client, | |||
450 | { | 450 | { |
451 | int ret, icnt; | 451 | int ret, icnt; |
452 | struct lp8755_chip *pchip; | 452 | struct lp8755_chip *pchip; |
453 | struct lp8755_platform_data *pdata = client->dev.platform_data; | 453 | struct lp8755_platform_data *pdata = dev_get_platdata(&client->dev); |
454 | 454 | ||
455 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 455 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
456 | dev_err(&client->dev, "i2c functionality check fail.\n"); | 456 | dev_err(&client->dev, "i2c functionality check fail.\n"); |
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index 54af61015814..3a599ee0a456 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c | |||
@@ -163,7 +163,7 @@ static int max1586_pmic_probe(struct i2c_client *client, | |||
163 | const struct i2c_device_id *i2c_id) | 163 | const struct i2c_device_id *i2c_id) |
164 | { | 164 | { |
165 | struct regulator_dev **rdev; | 165 | struct regulator_dev **rdev; |
166 | struct max1586_platform_data *pdata = client->dev.platform_data; | 166 | struct max1586_platform_data *pdata = dev_get_platdata(&client->dev); |
167 | struct regulator_config config = { }; | 167 | struct regulator_config config = { }; |
168 | struct max1586_data *max1586; | 168 | struct max1586_data *max1586; |
169 | int i, id, ret = -ENOMEM; | 169 | int i, id, ret = -ENOMEM; |
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index db6c9be10f3f..19c6f08eafd5 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c | |||
@@ -152,7 +152,7 @@ static struct regmap_config max8649_regmap_config = { | |||
152 | static int max8649_regulator_probe(struct i2c_client *client, | 152 | static int max8649_regulator_probe(struct i2c_client *client, |
153 | const struct i2c_device_id *id) | 153 | const struct i2c_device_id *id) |
154 | { | 154 | { |
155 | struct max8649_platform_data *pdata = client->dev.platform_data; | 155 | struct max8649_platform_data *pdata = dev_get_platdata(&client->dev); |
156 | struct max8649_regulator_info *info = NULL; | 156 | struct max8649_regulator_info *info = NULL; |
157 | struct regulator_config config = { }; | 157 | struct regulator_config config = { }; |
158 | unsigned int val; | 158 | unsigned int val; |
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index d428ef9a626f..144bcacd734d 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c | |||
@@ -44,6 +44,9 @@ | |||
44 | #include <linux/regulator/driver.h> | 44 | #include <linux/regulator/driver.h> |
45 | #include <linux/slab.h> | 45 | #include <linux/slab.h> |
46 | #include <linux/regulator/max8660.h> | 46 | #include <linux/regulator/max8660.h> |
47 | #include <linux/of.h> | ||
48 | #include <linux/of_device.h> | ||
49 | #include <linux/regulator/of_regulator.h> | ||
47 | 50 | ||
48 | #define MAX8660_DCDC_MIN_UV 725000 | 51 | #define MAX8660_DCDC_MIN_UV 725000 |
49 | #define MAX8660_DCDC_MAX_UV 1800000 | 52 | #define MAX8660_DCDC_MAX_UV 1800000 |
@@ -305,21 +308,105 @@ static const struct regulator_desc max8660_reg[] = { | |||
305 | }, | 308 | }, |
306 | }; | 309 | }; |
307 | 310 | ||
311 | enum { | ||
312 | MAX8660 = 0, | ||
313 | MAX8661 = 1, | ||
314 | }; | ||
315 | |||
316 | #ifdef CONFIG_OF | ||
317 | static const struct of_device_id max8660_dt_ids[] = { | ||
318 | { .compatible = "maxim,max8660", .data = (void *) MAX8660 }, | ||
319 | { .compatible = "maxim,max8661", .data = (void *) MAX8661 }, | ||
320 | { } | ||
321 | }; | ||
322 | MODULE_DEVICE_TABLE(of, max8660_dt_ids); | ||
323 | |||
324 | static int max8660_pdata_from_dt(struct device *dev, | ||
325 | struct device_node **of_node, | ||
326 | struct max8660_platform_data *pdata) | ||
327 | { | ||
328 | int matched, i; | ||
329 | struct device_node *np; | ||
330 | struct max8660_subdev_data *sub; | ||
331 | struct of_regulator_match rmatch[ARRAY_SIZE(max8660_reg)]; | ||
332 | |||
333 | np = of_find_node_by_name(dev->of_node, "regulators"); | ||
334 | if (!np) { | ||
335 | dev_err(dev, "missing 'regulators' subnode in DT\n"); | ||
336 | return -EINVAL; | ||
337 | } | ||
338 | |||
339 | for (i = 0; i < ARRAY_SIZE(rmatch); i++) | ||
340 | rmatch[i].name = max8660_reg[i].name; | ||
341 | |||
342 | matched = of_regulator_match(dev, np, rmatch, ARRAY_SIZE(rmatch)); | ||
343 | if (matched <= 0) | ||
344 | return matched; | ||
345 | |||
346 | pdata->subdevs = devm_kzalloc(dev, sizeof(struct max8660_subdev_data) * | ||
347 | matched, GFP_KERNEL); | ||
348 | if (!pdata->subdevs) | ||
349 | return -ENOMEM; | ||
350 | |||
351 | pdata->num_subdevs = matched; | ||
352 | sub = pdata->subdevs; | ||
353 | |||
354 | for (i = 0; i < matched; i++) { | ||
355 | sub->id = i; | ||
356 | sub->name = rmatch[i].name; | ||
357 | sub->platform_data = rmatch[i].init_data; | ||
358 | of_node[i] = rmatch[i].of_node; | ||
359 | sub++; | ||
360 | } | ||
361 | |||
362 | return 0; | ||
363 | } | ||
364 | #else | ||
365 | static inline int max8660_pdata_from_dt(struct device *dev, | ||
366 | struct device_node **of_node, | ||
367 | struct max8660_platform_data *pdata) | ||
368 | { | ||
369 | return 0; | ||
370 | } | ||
371 | #endif | ||
372 | |||
308 | static int max8660_probe(struct i2c_client *client, | 373 | static int max8660_probe(struct i2c_client *client, |
309 | const struct i2c_device_id *i2c_id) | 374 | const struct i2c_device_id *i2c_id) |
310 | { | 375 | { |
311 | struct regulator_dev **rdev; | 376 | struct regulator_dev **rdev; |
312 | struct max8660_platform_data *pdata = client->dev.platform_data; | 377 | struct device *dev = &client->dev; |
378 | struct max8660_platform_data *pdata = dev_get_platdata(dev); | ||
313 | struct regulator_config config = { }; | 379 | struct regulator_config config = { }; |
314 | struct max8660 *max8660; | 380 | struct max8660 *max8660; |
315 | int boot_on, i, id, ret = -EINVAL; | 381 | int boot_on, i, id, ret = -EINVAL; |
382 | struct device_node *of_node[MAX8660_V_END]; | ||
383 | unsigned long type; | ||
384 | |||
385 | if (dev->of_node && !pdata) { | ||
386 | const struct of_device_id *id; | ||
387 | struct max8660_platform_data pdata_of; | ||
388 | |||
389 | id = of_match_device(of_match_ptr(max8660_dt_ids), dev); | ||
390 | if (!id) | ||
391 | return -ENODEV; | ||
392 | |||
393 | ret = max8660_pdata_from_dt(dev, of_node, &pdata_of); | ||
394 | if (ret < 0) | ||
395 | return ret; | ||
396 | |||
397 | pdata = &pdata_of; | ||
398 | type = (unsigned long) id->data; | ||
399 | } else { | ||
400 | type = i2c_id->driver_data; | ||
401 | memset(of_node, 0, sizeof(of_node)); | ||
402 | } | ||
316 | 403 | ||
317 | if (pdata->num_subdevs > MAX8660_V_END) { | 404 | if (pdata->num_subdevs > MAX8660_V_END) { |
318 | dev_err(&client->dev, "Too many regulators found!\n"); | 405 | dev_err(dev, "Too many regulators found!\n"); |
319 | return -EINVAL; | 406 | return -EINVAL; |
320 | } | 407 | } |
321 | 408 | ||
322 | max8660 = devm_kzalloc(&client->dev, sizeof(struct max8660) + | 409 | max8660 = devm_kzalloc(dev, sizeof(struct max8660) + |
323 | sizeof(struct regulator_dev *) * MAX8660_V_END, | 410 | sizeof(struct regulator_dev *) * MAX8660_V_END, |
324 | GFP_KERNEL); | 411 | GFP_KERNEL); |
325 | if (!max8660) | 412 | if (!max8660) |
@@ -376,8 +463,8 @@ static int max8660_probe(struct i2c_client *client, | |||
376 | break; | 463 | break; |
377 | 464 | ||
378 | case MAX8660_V7: | 465 | case MAX8660_V7: |
379 | if (!strcmp(i2c_id->name, "max8661")) { | 466 | if (type == MAX8661) { |
380 | dev_err(&client->dev, "Regulator not on this chip!\n"); | 467 | dev_err(dev, "Regulator not on this chip!\n"); |
381 | goto err_out; | 468 | goto err_out; |
382 | } | 469 | } |
383 | 470 | ||
@@ -386,7 +473,7 @@ static int max8660_probe(struct i2c_client *client, | |||
386 | break; | 473 | break; |
387 | 474 | ||
388 | default: | 475 | default: |
389 | dev_err(&client->dev, "invalid regulator %s\n", | 476 | dev_err(dev, "invalid regulator %s\n", |
390 | pdata->subdevs[i].name); | 477 | pdata->subdevs[i].name); |
391 | goto err_out; | 478 | goto err_out; |
392 | } | 479 | } |
@@ -397,14 +484,15 @@ static int max8660_probe(struct i2c_client *client, | |||
397 | 484 | ||
398 | id = pdata->subdevs[i].id; | 485 | id = pdata->subdevs[i].id; |
399 | 486 | ||
400 | config.dev = &client->dev; | 487 | config.dev = dev; |
401 | config.init_data = pdata->subdevs[i].platform_data; | 488 | config.init_data = pdata->subdevs[i].platform_data; |
489 | config.of_node = of_node[i]; | ||
402 | config.driver_data = max8660; | 490 | config.driver_data = max8660; |
403 | 491 | ||
404 | rdev[i] = regulator_register(&max8660_reg[id], &config); | 492 | rdev[i] = regulator_register(&max8660_reg[id], &config); |
405 | if (IS_ERR(rdev[i])) { | 493 | if (IS_ERR(rdev[i])) { |
406 | ret = PTR_ERR(rdev[i]); | 494 | ret = PTR_ERR(rdev[i]); |
407 | dev_err(&client->dev, "failed to register %s\n", | 495 | dev_err(dev, "failed to register %s\n", |
408 | max8660_reg[id].name); | 496 | max8660_reg[id].name); |
409 | goto err_unregister; | 497 | goto err_unregister; |
410 | } | 498 | } |
@@ -431,8 +519,8 @@ static int max8660_remove(struct i2c_client *client) | |||
431 | } | 519 | } |
432 | 520 | ||
433 | static const struct i2c_device_id max8660_id[] = { | 521 | static const struct i2c_device_id max8660_id[] = { |
434 | { "max8660", 0 }, | 522 | { .name = "max8660", .driver_data = MAX8660 }, |
435 | { "max8661", 0 }, | 523 | { .name = "max8661", .driver_data = MAX8661 }, |
436 | { } | 524 | { } |
437 | }; | 525 | }; |
438 | MODULE_DEVICE_TABLE(i2c, max8660_id); | 526 | MODULE_DEVICE_TABLE(i2c, max8660_id); |
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index e6d54a546d36..d80b5fa758ae 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -277,7 +277,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, | |||
277 | static int max8925_regulator_probe(struct platform_device *pdev) | 277 | static int max8925_regulator_probe(struct platform_device *pdev) |
278 | { | 278 | { |
279 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | 279 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
280 | struct regulator_init_data *pdata = pdev->dev.platform_data; | 280 | struct regulator_init_data *pdata = dev_get_platdata(&pdev->dev); |
281 | struct regulator_config config = { }; | 281 | struct regulator_config config = { }; |
282 | struct max8925_regulator_info *ri; | 282 | struct max8925_regulator_info *ri; |
283 | struct resource *res; | 283 | struct resource *res; |
diff --git a/drivers/regulator/max8952.c b/drivers/regulator/max8952.c index 5259c2fea90a..788e5ae2af1b 100644 --- a/drivers/regulator/max8952.c +++ b/drivers/regulator/max8952.c | |||
@@ -196,7 +196,7 @@ static int max8952_pmic_probe(struct i2c_client *client, | |||
196 | const struct i2c_device_id *i2c_id) | 196 | const struct i2c_device_id *i2c_id) |
197 | { | 197 | { |
198 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); | 198 | struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent); |
199 | struct max8952_platform_data *pdata = client->dev.platform_data; | 199 | struct max8952_platform_data *pdata = dev_get_platdata(&client->dev); |
200 | struct regulator_config config = { }; | 200 | struct regulator_config config = { }; |
201 | struct max8952_data *max8952; | 201 | struct max8952_data *max8952; |
202 | 202 | ||
diff --git a/drivers/regulator/max8973-regulator.c b/drivers/regulator/max8973-regulator.c index 0c5195a842e2..5b77ab7762e4 100644 --- a/drivers/regulator/max8973-regulator.c +++ b/drivers/regulator/max8973-regulator.c | |||
@@ -371,7 +371,7 @@ static int max8973_probe(struct i2c_client *client, | |||
371 | struct max8973_chip *max; | 371 | struct max8973_chip *max; |
372 | int ret; | 372 | int ret; |
373 | 373 | ||
374 | pdata = client->dev.platform_data; | 374 | pdata = dev_get_platdata(&client->dev); |
375 | 375 | ||
376 | if (!pdata && !client->dev.of_node) { | 376 | if (!pdata && !client->dev.of_node) { |
377 | dev_err(&client->dev, "No Platform data"); | 377 | dev_err(&client->dev, "No Platform data"); |
diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index d0c87856dd25..e8877e4e5a5a 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c | |||
@@ -765,7 +765,7 @@ static void palmas_dt_to_pdata(struct device *dev, | |||
765 | static int palmas_regulators_probe(struct platform_device *pdev) | 765 | static int palmas_regulators_probe(struct platform_device *pdev) |
766 | { | 766 | { |
767 | struct palmas *palmas = dev_get_drvdata(pdev->dev.parent); | 767 | struct palmas *palmas = dev_get_drvdata(pdev->dev.parent); |
768 | struct palmas_pmic_platform_data *pdata = pdev->dev.platform_data; | 768 | struct palmas_pmic_platform_data *pdata = dev_get_platdata(&pdev->dev); |
769 | struct device_node *node = pdev->dev.of_node; | 769 | struct device_node *node = pdev->dev.of_node; |
770 | struct regulator_dev *rdev; | 770 | struct regulator_dev *rdev; |
771 | struct regulator_config config = { }; | 771 | struct regulator_config config = { }; |
diff --git a/drivers/regulator/pcap-regulator.c b/drivers/regulator/pcap-regulator.c index 1a73a297fe73..b49eaeedea84 100644 --- a/drivers/regulator/pcap-regulator.c +++ b/drivers/regulator/pcap-regulator.c | |||
@@ -243,7 +243,7 @@ static int pcap_regulator_probe(struct platform_device *pdev) | |||
243 | struct regulator_config config = { }; | 243 | struct regulator_config config = { }; |
244 | 244 | ||
245 | config.dev = &pdev->dev; | 245 | config.dev = &pdev->dev; |
246 | config.init_data = pdev->dev.platform_data; | 246 | config.init_data = dev_get_platdata(&pdev->dev); |
247 | config.driver_data = pcap; | 247 | config.driver_data = pcap; |
248 | 248 | ||
249 | rdev = regulator_register(&pcap_regulators[pdev->id], &config); | 249 | rdev = regulator_register(&pcap_regulators[pdev->id], &config); |
diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c index 54df9f7cb504..0f3576d48abf 100644 --- a/drivers/regulator/pcf50633-regulator.c +++ b/drivers/regulator/pcf50633-regulator.c | |||
@@ -86,7 +86,7 @@ static int pcf50633_regulator_probe(struct platform_device *pdev) | |||
86 | pcf = dev_to_pcf50633(pdev->dev.parent); | 86 | pcf = dev_to_pcf50633(pdev->dev.parent); |
87 | 87 | ||
88 | config.dev = &pdev->dev; | 88 | config.dev = &pdev->dev; |
89 | config.init_data = pdev->dev.platform_data; | 89 | config.init_data = dev_get_platdata(&pdev->dev); |
90 | config.driver_data = pcf; | 90 | config.driver_data = pcf; |
91 | config.regmap = pcf->regmap; | 91 | config.regmap = pcf->regmap; |
92 | 92 | ||
diff --git a/drivers/regulator/tps51632-regulator.c b/drivers/regulator/tps51632-regulator.c index 6e67be75ea1b..9392a7ca3d2d 100644 --- a/drivers/regulator/tps51632-regulator.c +++ b/drivers/regulator/tps51632-regulator.c | |||
@@ -275,7 +275,7 @@ static int tps51632_probe(struct i2c_client *client, | |||
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | pdata = client->dev.platform_data; | 278 | pdata = dev_get_platdata(&client->dev); |
279 | if (!pdata && client->dev.of_node) | 279 | if (!pdata && client->dev.of_node) |
280 | pdata = of_get_tps51632_platform_data(&client->dev); | 280 | pdata = of_get_tps51632_platform_data(&client->dev); |
281 | if (!pdata) { | 281 | if (!pdata) { |
diff --git a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c index a490d5b749b2..0b7ebb1ebf85 100644 --- a/drivers/regulator/tps62360-regulator.c +++ b/drivers/regulator/tps62360-regulator.c | |||
@@ -350,7 +350,7 @@ static int tps62360_probe(struct i2c_client *client, | |||
350 | int i; | 350 | int i; |
351 | int chip_id; | 351 | int chip_id; |
352 | 352 | ||
353 | pdata = client->dev.platform_data; | 353 | pdata = dev_get_platdata(&client->dev); |
354 | 354 | ||
355 | if (client->dev.of_node) { | 355 | if (client->dev.of_node) { |
356 | const struct of_device_id *match; | 356 | const struct of_device_id *match; |
diff --git a/drivers/regulator/tps65023-regulator.c b/drivers/regulator/tps65023-regulator.c index 9d053e23e9eb..a15263d4bdff 100644 --- a/drivers/regulator/tps65023-regulator.c +++ b/drivers/regulator/tps65023-regulator.c | |||
@@ -218,7 +218,7 @@ static int tps_65023_probe(struct i2c_client *client, | |||
218 | * init_data points to array of regulator_init structures | 218 | * init_data points to array of regulator_init structures |
219 | * coming from the board-evm file. | 219 | * coming from the board-evm file. |
220 | */ | 220 | */ |
221 | init_data = client->dev.platform_data; | 221 | init_data = dev_get_platdata(&client->dev); |
222 | if (!init_data) | 222 | if (!init_data) |
223 | return -EIO; | 223 | return -EIO; |
224 | 224 | ||
diff --git a/drivers/regulator/tps6524x-regulator.c b/drivers/regulator/tps6524x-regulator.c index 1094393155ed..62e8d28beabd 100644 --- a/drivers/regulator/tps6524x-regulator.c +++ b/drivers/regulator/tps6524x-regulator.c | |||
@@ -601,7 +601,7 @@ static int pmic_probe(struct spi_device *spi) | |||
601 | struct regulator_config config = { }; | 601 | struct regulator_config config = { }; |
602 | int ret = 0, i; | 602 | int ret = 0, i; |
603 | 603 | ||
604 | init_data = dev->platform_data; | 604 | init_data = dev_get_platdata(dev); |
605 | if (!init_data) { | 605 | if (!init_data) { |
606 | dev_err(dev, "could not find regulator platform data\n"); | 606 | dev_err(dev, "could not find regulator platform data\n"); |
607 | return -EINVAL; | 607 | return -EINVAL; |
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 93bc4f456da4..78aae4cbb004 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c | |||
@@ -1108,7 +1108,7 @@ static int twlreg_probe(struct platform_device *pdev) | |||
1108 | drvdata = NULL; | 1108 | drvdata = NULL; |
1109 | } else { | 1109 | } else { |
1110 | id = pdev->id; | 1110 | id = pdev->id; |
1111 | initdata = pdev->dev.platform_data; | 1111 | initdata = dev_get_platdata(&pdev->dev); |
1112 | for (i = 0, template = NULL; i < ARRAY_SIZE(twl_of_match); i++) { | 1112 | for (i = 0, template = NULL; i < ARRAY_SIZE(twl_of_match); i++) { |
1113 | template = twl_of_match[i].data; | 1113 | template = twl_of_match[i].data; |
1114 | if (template && template->desc.id == id) | 1114 | if (template && template->desc.id == id) |
diff --git a/drivers/regulator/userspace-consumer.c b/drivers/regulator/userspace-consumer.c index a7c8deb5f28f..765acc11c9c8 100644 --- a/drivers/regulator/userspace-consumer.c +++ b/drivers/regulator/userspace-consumer.c | |||
@@ -111,7 +111,7 @@ static int regulator_userspace_consumer_probe(struct platform_device *pdev) | |||
111 | struct userspace_consumer_data *drvdata; | 111 | struct userspace_consumer_data *drvdata; |
112 | int ret; | 112 | int ret; |
113 | 113 | ||
114 | pdata = pdev->dev.platform_data; | 114 | pdata = dev_get_platdata(&pdev->dev); |
115 | if (!pdata) | 115 | if (!pdata) |
116 | return -EINVAL; | 116 | return -EINVAL; |
117 | 117 | ||
diff --git a/drivers/regulator/virtual.c b/drivers/regulator/virtual.c index a9d4284ea007..f53e78b9a84e 100644 --- a/drivers/regulator/virtual.c +++ b/drivers/regulator/virtual.c | |||
@@ -287,7 +287,7 @@ static const struct attribute_group regulator_virtual_attr_group = { | |||
287 | 287 | ||
288 | static int regulator_virtual_probe(struct platform_device *pdev) | 288 | static int regulator_virtual_probe(struct platform_device *pdev) |
289 | { | 289 | { |
290 | char *reg_id = pdev->dev.platform_data; | 290 | char *reg_id = dev_get_platdata(&pdev->dev); |
291 | struct virtual_consumer_data *drvdata; | 291 | struct virtual_consumer_data *drvdata; |
292 | int ret; | 292 | int ret; |
293 | 293 | ||
diff --git a/drivers/regulator/wm831x-dcdc.c b/drivers/regulator/wm831x-dcdc.c index 46938cf162ad..11861cb861df 100644 --- a/drivers/regulator/wm831x-dcdc.c +++ b/drivers/regulator/wm831x-dcdc.c | |||
@@ -451,7 +451,7 @@ static void wm831x_buckv_dvs_init(struct wm831x_dcdc *dcdc, | |||
451 | static int wm831x_buckv_probe(struct platform_device *pdev) | 451 | static int wm831x_buckv_probe(struct platform_device *pdev) |
452 | { | 452 | { |
453 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 453 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
454 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 454 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
455 | struct regulator_config config = { }; | 455 | struct regulator_config config = { }; |
456 | int id; | 456 | int id; |
457 | struct wm831x_dcdc *dcdc; | 457 | struct wm831x_dcdc *dcdc; |
@@ -624,7 +624,7 @@ static struct regulator_ops wm831x_buckp_ops = { | |||
624 | static int wm831x_buckp_probe(struct platform_device *pdev) | 624 | static int wm831x_buckp_probe(struct platform_device *pdev) |
625 | { | 625 | { |
626 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 626 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
627 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 627 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
628 | struct regulator_config config = { }; | 628 | struct regulator_config config = { }; |
629 | int id; | 629 | int id; |
630 | struct wm831x_dcdc *dcdc; | 630 | struct wm831x_dcdc *dcdc; |
@@ -770,7 +770,7 @@ static struct regulator_ops wm831x_boostp_ops = { | |||
770 | static int wm831x_boostp_probe(struct platform_device *pdev) | 770 | static int wm831x_boostp_probe(struct platform_device *pdev) |
771 | { | 771 | { |
772 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 772 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
773 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 773 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
774 | struct regulator_config config = { }; | 774 | struct regulator_config config = { }; |
775 | int id = pdev->id % ARRAY_SIZE(pdata->dcdc); | 775 | int id = pdev->id % ARRAY_SIZE(pdata->dcdc); |
776 | struct wm831x_dcdc *dcdc; | 776 | struct wm831x_dcdc *dcdc; |
@@ -880,7 +880,7 @@ static struct regulator_ops wm831x_epe_ops = { | |||
880 | static int wm831x_epe_probe(struct platform_device *pdev) | 880 | static int wm831x_epe_probe(struct platform_device *pdev) |
881 | { | 881 | { |
882 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 882 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
883 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 883 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
884 | struct regulator_config config = { }; | 884 | struct regulator_config config = { }; |
885 | int id = pdev->id % ARRAY_SIZE(pdata->epe); | 885 | int id = pdev->id % ARRAY_SIZE(pdata->epe); |
886 | struct wm831x_dcdc *dcdc; | 886 | struct wm831x_dcdc *dcdc; |
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c index 16ebdf94d0a0..4eb373de1fac 100644 --- a/drivers/regulator/wm831x-isink.c +++ b/drivers/regulator/wm831x-isink.c | |||
@@ -151,7 +151,7 @@ static irqreturn_t wm831x_isink_irq(int irq, void *data) | |||
151 | static int wm831x_isink_probe(struct platform_device *pdev) | 151 | static int wm831x_isink_probe(struct platform_device *pdev) |
152 | { | 152 | { |
153 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 153 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
154 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 154 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
155 | struct wm831x_isink *isink; | 155 | struct wm831x_isink *isink; |
156 | int id = pdev->id % ARRAY_SIZE(pdata->isink); | 156 | int id = pdev->id % ARRAY_SIZE(pdata->isink); |
157 | struct regulator_config config = { }; | 157 | struct regulator_config config = { }; |
diff --git a/drivers/regulator/wm831x-ldo.c b/drivers/regulator/wm831x-ldo.c index 76792c7d86f3..1432b26ef2e9 100644 --- a/drivers/regulator/wm831x-ldo.c +++ b/drivers/regulator/wm831x-ldo.c | |||
@@ -221,7 +221,7 @@ static struct regulator_ops wm831x_gp_ldo_ops = { | |||
221 | static int wm831x_gp_ldo_probe(struct platform_device *pdev) | 221 | static int wm831x_gp_ldo_probe(struct platform_device *pdev) |
222 | { | 222 | { |
223 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 223 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
224 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 224 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
225 | struct regulator_config config = { }; | 225 | struct regulator_config config = { }; |
226 | int id; | 226 | int id; |
227 | struct wm831x_ldo *ldo; | 227 | struct wm831x_ldo *ldo; |
@@ -447,7 +447,7 @@ static struct regulator_ops wm831x_aldo_ops = { | |||
447 | static int wm831x_aldo_probe(struct platform_device *pdev) | 447 | static int wm831x_aldo_probe(struct platform_device *pdev) |
448 | { | 448 | { |
449 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 449 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
450 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 450 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
451 | struct regulator_config config = { }; | 451 | struct regulator_config config = { }; |
452 | int id; | 452 | int id; |
453 | struct wm831x_ldo *ldo; | 453 | struct wm831x_ldo *ldo; |
@@ -605,7 +605,7 @@ static struct regulator_ops wm831x_alive_ldo_ops = { | |||
605 | static int wm831x_alive_ldo_probe(struct platform_device *pdev) | 605 | static int wm831x_alive_ldo_probe(struct platform_device *pdev) |
606 | { | 606 | { |
607 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 607 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
608 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 608 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
609 | struct regulator_config config = { }; | 609 | struct regulator_config config = { }; |
610 | int id; | 610 | int id; |
611 | struct wm831x_ldo *ldo; | 611 | struct wm831x_ldo *ldo; |
diff --git a/drivers/regulator/wm8350-regulator.c b/drivers/regulator/wm8350-regulator.c index 5453dd0105ed..835b5f0f344e 100644 --- a/drivers/regulator/wm8350-regulator.c +++ b/drivers/regulator/wm8350-regulator.c | |||
@@ -1201,7 +1201,7 @@ static int wm8350_regulator_probe(struct platform_device *pdev) | |||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | config.dev = &pdev->dev; | 1203 | config.dev = &pdev->dev; |
1204 | config.init_data = pdev->dev.platform_data; | 1204 | config.init_data = dev_get_platdata(&pdev->dev); |
1205 | config.driver_data = dev_get_drvdata(&pdev->dev); | 1205 | config.driver_data = dev_get_drvdata(&pdev->dev); |
1206 | config.regmap = wm8350->regmap; | 1206 | config.regmap = wm8350->regmap; |
1207 | 1207 | ||
diff --git a/drivers/regulator/wm8400-regulator.c b/drivers/regulator/wm8400-regulator.c index 2ac7e1aceb05..58f51bec13f2 100644 --- a/drivers/regulator/wm8400-regulator.c +++ b/drivers/regulator/wm8400-regulator.c | |||
@@ -215,7 +215,7 @@ static int wm8400_regulator_probe(struct platform_device *pdev) | |||
215 | struct regulator_dev *rdev; | 215 | struct regulator_dev *rdev; |
216 | 216 | ||
217 | config.dev = &pdev->dev; | 217 | config.dev = &pdev->dev; |
218 | config.init_data = pdev->dev.platform_data; | 218 | config.init_data = dev_get_platdata(&pdev->dev); |
219 | config.driver_data = wm8400; | 219 | config.driver_data = wm8400; |
220 | config.regmap = wm8400->regmap; | 220 | config.regmap = wm8400->regmap; |
221 | 221 | ||
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c index 8f2a8a7a3f99..5ee2a208457c 100644 --- a/drivers/regulator/wm8994-regulator.c +++ b/drivers/regulator/wm8994-regulator.c | |||
@@ -125,7 +125,7 @@ static const struct regulator_init_data wm8994_ldo_default[] = { | |||
125 | static int wm8994_ldo_probe(struct platform_device *pdev) | 125 | static int wm8994_ldo_probe(struct platform_device *pdev) |
126 | { | 126 | { |
127 | struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); | 127 | struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); |
128 | struct wm8994_pdata *pdata = wm8994->dev->platform_data; | 128 | struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev); |
129 | int id = pdev->id % ARRAY_SIZE(pdata->ldo); | 129 | int id = pdev->id % ARRAY_SIZE(pdata->ldo); |
130 | struct regulator_config config = { }; | 130 | struct regulator_config config = { }; |
131 | struct wm8994_ldo *ldo; | 131 | struct wm8994_ldo *ldo; |