aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/88pm8607.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-03 19:50:22 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-09 07:37:09 -0400
commitc172708d38a401b2f3f841dfcd862b469fa0b670 (patch)
tree75e89c63fd0c76a2c69bb5ad6e45b3762bceb6b6 /drivers/regulator/88pm8607.c
parent1474e4dbcae04125ed6e503eadcef266846f4675 (diff)
regulator: core: Use a struct to pass in regulator runtime configuration
Rather than adding new arguments to regulator_register() every time we want to add a new bit of dynamic information at runtime change the function to take these via a struct. By doing this we avoid needing to do further changes like the recent addition of device tree support which required each regulator driver to be updated to take an additional parameter. The regulator_desc which should (mostly) be static data is still passed separately as most drivers are able to configure this statically at build time. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/88pm8607.c')
-rw-r--r--drivers/regulator/88pm8607.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c
index 11e5ddd7e796..d04fbe953dd8 100644
--- a/drivers/regulator/88pm8607.c
+++ b/drivers/regulator/88pm8607.c
@@ -365,6 +365,7 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
365 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 365 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
366 struct pm8607_regulator_info *info = NULL; 366 struct pm8607_regulator_info *info = NULL;
367 struct regulator_init_data *pdata = pdev->dev.platform_data; 367 struct regulator_init_data *pdata = pdev->dev.platform_data;
368 struct regulator_config config = { };
368 struct resource *res; 369 struct resource *res;
369 int i; 370 int i;
370 371
@@ -390,9 +391,12 @@ static int __devinit pm8607_regulator_probe(struct platform_device *pdev)
390 if ((i == PM8607_ID_BUCK3) && info->chip->buck3_double) 391 if ((i == PM8607_ID_BUCK3) && info->chip->buck3_double)
391 info->slope_double = 1; 392 info->slope_double = 1;
392 393
394 config.dev = &pdev->dev;
395 config.init_data = pdata;
396 config.driver_data = info;
397
393 /* replace driver_data with info */ 398 /* replace driver_data with info */
394 info->regulator = regulator_register(&info->desc, &pdev->dev, 399 info->regulator = regulator_register(&info->desc, &config);
395 pdata, info, NULL);
396 if (IS_ERR(info->regulator)) { 400 if (IS_ERR(info->regulator)) {
397 dev_err(&pdev->dev, "failed to register regulator %s\n", 401 dev_err(&pdev->dev, "failed to register regulator %s\n",
398 info->desc.name); 402 info->desc.name);