Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Jingoo Han and committed by
Mark Brown
dff91d0b 6625d9d2

+43 -43
+1 -1
drivers/regulator/88pm800.c
··· 283 283 static int pm800_regulator_probe(struct platform_device *pdev) 284 284 { 285 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 287 struct pm800_regulators *pm800_data; 288 288 struct pm800_regulator_info *info; 289 289 struct regulator_config config = { };
+1 -1
drivers/regulator/88pm8607.c
··· 346 346 { 347 347 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 348 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 350 struct regulator_config config = { }; 351 351 struct resource *res; 352 352 int i;
+1 -1
drivers/regulator/aat2870-regulator.c
··· 174 174 175 175 config.dev = &pdev->dev; 176 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 179 rdev = regulator_register(&ri->desc, &config); 180 180 if (IS_ERR(rdev)) {
+1 -1
drivers/regulator/ab3100.c
··· 660 660 661 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 664 struct device_node *np = pdev->dev.of_node; 665 665 int err = 0; 666 666 u8 data;
+1 -1
drivers/regulator/ad5398.c
··· 214 214 static int ad5398_probe(struct i2c_client *client, 215 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 218 struct regulator_config config = { }; 219 219 struct ad5398_chip_info *chip; 220 220 const struct ad5398_current_data_format *df =
+1 -1
drivers/regulator/da903x.c
··· 485 485 ri->desc.ops = &da9030_regulator_ldo1_15_ops; 486 486 487 487 config.dev = &pdev->dev; 488 - config.init_data = pdev->dev.platform_data; 488 + config.init_data = dev_get_platdata(&pdev->dev); 489 489 config.driver_data = ri; 490 490 491 491 rdev = regulator_register(&ri->desc, &config);
+1 -1
drivers/regulator/da9052-regulator.c
··· 349 349 return -ENOMEM; 350 350 351 351 da9052 = dev_get_drvdata(pdev->dev.parent); 352 - pdata = da9052->dev->platform_data; 352 + pdata = dev_get_platdata(da9052->dev); 353 353 regulator->da9052 = da9052; 354 354 355 355 regulator->info = find_regulator_info(regulator->da9052->chip_id,
+1 -1
drivers/regulator/da9055-regulator.c
··· 535 535 struct regulator_config config = { }; 536 536 struct da9055_regulator *regulator; 537 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 539 int ret, irq; 540 540 541 541 if (pdata == NULL || pdata->regulators[pdev->id] == NULL)
+1 -1
drivers/regulator/fan53555.c
··· 237 237 unsigned int val; 238 238 int ret; 239 239 240 - pdata = client->dev.platform_data; 240 + pdata = dev_get_platdata(&client->dev); 241 241 if (!pdata || !pdata->regulator) { 242 242 dev_err(&client->dev, "Platform data not found!\n"); 243 243 return -ENODEV;
+1 -1
drivers/regulator/fixed.c
··· 146 146 if (IS_ERR(config)) 147 147 return PTR_ERR(config); 148 148 } else { 149 - config = pdev->dev.platform_data; 149 + config = dev_get_platdata(&pdev->dev); 150 150 } 151 151 152 152 if (!config)
+1 -1
drivers/regulator/gpio-regulator.c
··· 219 219 220 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 223 struct device_node *np = pdev->dev.of_node; 224 224 struct gpio_regulator_data *drvdata; 225 225 struct regulator_config cfg = { };
+1 -1
drivers/regulator/isl6271a-regulator.c
··· 110 110 const struct i2c_device_id *id) 111 111 { 112 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 114 struct isl_pmic *pmic; 115 115 int err, i; 116 116
+1 -1
drivers/regulator/lp3971.c
··· 425 425 const struct i2c_device_id *id) 426 426 { 427 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 429 int ret; 430 430 u16 val; 431 431
+1 -1
drivers/regulator/lp3972.c
··· 519 519 const struct i2c_device_id *id) 520 520 { 521 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 523 int ret; 524 524 u16 val; 525 525
+1 -1
drivers/regulator/lp872x.c
··· 961 961 } 962 962 963 963 lp->dev = &cl->dev; 964 - lp->pdata = cl->dev.platform_data; 964 + lp->pdata = dev_get_platdata(&cl->dev); 965 965 lp->chipid = id->driver_data; 966 966 lp->num_regulators = num_regulators; 967 967 i2c_set_clientdata(cl, lp);
+1 -1
drivers/regulator/lp8755.c
··· 449 449 { 450 450 int ret, icnt; 451 451 struct lp8755_chip *pchip; 452 - struct lp8755_platform_data *pdata = client->dev.platform_data; 452 + struct lp8755_platform_data *pdata = dev_get_platdata(&client->dev); 453 453 454 454 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { 455 455 dev_err(&client->dev, "i2c functionality check fail.\n");
+1 -1
drivers/regulator/max1586.c
··· 163 163 const struct i2c_device_id *i2c_id) 164 164 { 165 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 167 struct regulator_config config = { }; 168 168 struct max1586_data *max1586; 169 169 int i, id, ret = -ENOMEM;
+1 -1
drivers/regulator/max8649.c
··· 152 152 static int max8649_regulator_probe(struct i2c_client *client, 153 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 156 struct max8649_regulator_info *info = NULL; 157 157 struct regulator_config config = { }; 158 158 unsigned int val;
+1 -1
drivers/regulator/max8660.c
··· 309 309 const struct i2c_device_id *i2c_id) 310 310 { 311 311 struct regulator_dev **rdev; 312 - struct max8660_platform_data *pdata = client->dev.platform_data; 312 + struct max8660_platform_data *pdata = dev_get_platdata(&client->dev); 313 313 struct regulator_config config = { }; 314 314 struct max8660 *max8660; 315 315 int boot_on, i, id, ret = -EINVAL;
+1 -1
drivers/regulator/max8925-regulator.c
··· 277 277 static int max8925_regulator_probe(struct platform_device *pdev) 278 278 { 279 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 281 struct regulator_config config = { }; 282 282 struct max8925_regulator_info *ri; 283 283 struct resource *res;
+1 -1
drivers/regulator/max8952.c
··· 196 196 const struct i2c_device_id *i2c_id) 197 197 { 198 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 200 struct regulator_config config = { }; 201 201 struct max8952_data *max8952; 202 202
+1 -1
drivers/regulator/max8973-regulator.c
··· 371 371 struct max8973_chip *max; 372 372 int ret; 373 373 374 - pdata = client->dev.platform_data; 374 + pdata = dev_get_platdata(&client->dev); 375 375 376 376 if (!pdata && !client->dev.of_node) { 377 377 dev_err(&client->dev, "No Platform data");
+1 -1
drivers/regulator/palmas-regulator.c
··· 765 765 static int palmas_regulators_probe(struct platform_device *pdev) 766 766 { 767 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 769 struct device_node *node = pdev->dev.of_node; 770 770 struct regulator_dev *rdev; 771 771 struct regulator_config config = { };
+1 -1
drivers/regulator/pcap-regulator.c
··· 243 243 struct regulator_config config = { }; 244 244 245 245 config.dev = &pdev->dev; 246 - config.init_data = pdev->dev.platform_data; 246 + config.init_data = dev_get_platdata(&pdev->dev); 247 247 config.driver_data = pcap; 248 248 249 249 rdev = regulator_register(&pcap_regulators[pdev->id], &config);
+1 -1
drivers/regulator/pcf50633-regulator.c
··· 86 86 pcf = dev_to_pcf50633(pdev->dev.parent); 87 87 88 88 config.dev = &pdev->dev; 89 - config.init_data = pdev->dev.platform_data; 89 + config.init_data = dev_get_platdata(&pdev->dev); 90 90 config.driver_data = pcf; 91 91 config.regmap = pcf->regmap; 92 92
+1 -1
drivers/regulator/tps51632-regulator.c
··· 275 275 } 276 276 } 277 277 278 - pdata = client->dev.platform_data; 278 + pdata = dev_get_platdata(&client->dev); 279 279 if (!pdata && client->dev.of_node) 280 280 pdata = of_get_tps51632_platform_data(&client->dev); 281 281 if (!pdata) {
+1 -1
drivers/regulator/tps62360-regulator.c
··· 350 350 int i; 351 351 int chip_id; 352 352 353 - pdata = client->dev.platform_data; 353 + pdata = dev_get_platdata(&client->dev); 354 354 355 355 if (client->dev.of_node) { 356 356 const struct of_device_id *match;
+1 -1
drivers/regulator/tps65023-regulator.c
··· 218 218 * init_data points to array of regulator_init structures 219 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 222 if (!init_data) 223 223 return -EIO; 224 224
+1 -1
drivers/regulator/tps6524x-regulator.c
··· 601 601 struct regulator_config config = { }; 602 602 int ret = 0, i; 603 603 604 - init_data = dev->platform_data; 604 + init_data = dev_get_platdata(dev); 605 605 if (!init_data) { 606 606 dev_err(dev, "could not find regulator platform data\n"); 607 607 return -EINVAL;
+1 -1
drivers/regulator/twl-regulator.c
··· 1108 1108 drvdata = NULL; 1109 1109 } else { 1110 1110 id = pdev->id; 1111 - initdata = pdev->dev.platform_data; 1111 + initdata = dev_get_platdata(&pdev->dev); 1112 1112 for (i = 0, template = NULL; i < ARRAY_SIZE(twl_of_match); i++) { 1113 1113 template = twl_of_match[i].data; 1114 1114 if (template && template->desc.id == id)
+1 -1
drivers/regulator/userspace-consumer.c
··· 111 111 struct userspace_consumer_data *drvdata; 112 112 int ret; 113 113 114 - pdata = pdev->dev.platform_data; 114 + pdata = dev_get_platdata(&pdev->dev); 115 115 if (!pdata) 116 116 return -EINVAL; 117 117
+1 -1
drivers/regulator/virtual.c
··· 287 287 288 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 291 struct virtual_consumer_data *drvdata; 292 292 int ret; 293 293
+4 -4
drivers/regulator/wm831x-dcdc.c
··· 451 451 static int wm831x_buckv_probe(struct platform_device *pdev) 452 452 { 453 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 455 struct regulator_config config = { }; 456 456 int id; 457 457 struct wm831x_dcdc *dcdc; ··· 624 624 static int wm831x_buckp_probe(struct platform_device *pdev) 625 625 { 626 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 628 struct regulator_config config = { }; 629 629 int id; 630 630 struct wm831x_dcdc *dcdc; ··· 770 770 static int wm831x_boostp_probe(struct platform_device *pdev) 771 771 { 772 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 774 struct regulator_config config = { }; 775 775 int id = pdev->id % ARRAY_SIZE(pdata->dcdc); 776 776 struct wm831x_dcdc *dcdc; ··· 880 880 static int wm831x_epe_probe(struct platform_device *pdev) 881 881 { 882 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 884 struct regulator_config config = { }; 885 885 int id = pdev->id % ARRAY_SIZE(pdata->epe); 886 886 struct wm831x_dcdc *dcdc;
+1 -1
drivers/regulator/wm831x-isink.c
··· 151 151 static int wm831x_isink_probe(struct platform_device *pdev) 152 152 { 153 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 155 struct wm831x_isink *isink; 156 156 int id = pdev->id % ARRAY_SIZE(pdata->isink); 157 157 struct regulator_config config = { };
+3 -3
drivers/regulator/wm831x-ldo.c
··· 221 221 static int wm831x_gp_ldo_probe(struct platform_device *pdev) 222 222 { 223 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 225 struct regulator_config config = { }; 226 226 int id; 227 227 struct wm831x_ldo *ldo; ··· 447 447 static int wm831x_aldo_probe(struct platform_device *pdev) 448 448 { 449 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 451 struct regulator_config config = { }; 452 452 int id; 453 453 struct wm831x_ldo *ldo; ··· 605 605 static int wm831x_alive_ldo_probe(struct platform_device *pdev) 606 606 { 607 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 609 struct regulator_config config = { }; 610 610 int id; 611 611 struct wm831x_ldo *ldo;
+1 -1
drivers/regulator/wm8350-regulator.c
··· 1201 1201 } 1202 1202 1203 1203 config.dev = &pdev->dev; 1204 - config.init_data = pdev->dev.platform_data; 1204 + config.init_data = dev_get_platdata(&pdev->dev); 1205 1205 config.driver_data = dev_get_drvdata(&pdev->dev); 1206 1206 config.regmap = wm8350->regmap; 1207 1207
+1 -1
drivers/regulator/wm8400-regulator.c
··· 215 215 struct regulator_dev *rdev; 216 216 217 217 config.dev = &pdev->dev; 218 - config.init_data = pdev->dev.platform_data; 218 + config.init_data = dev_get_platdata(&pdev->dev); 219 219 config.driver_data = wm8400; 220 220 config.regmap = wm8400->regmap; 221 221
+1 -1
drivers/regulator/wm8994-regulator.c
··· 125 125 static int wm8994_ldo_probe(struct platform_device *pdev) 126 126 { 127 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 129 int id = pdev->id % ARRAY_SIZE(pdata->ldo); 130 130 struct regulator_config config = { }; 131 131 struct wm8994_ldo *ldo;