diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-03 19:50:22 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-09 07:37:09 -0400 |
commit | c172708d38a401b2f3f841dfcd862b469fa0b670 (patch) | |
tree | 75e89c63fd0c76a2c69bb5ad6e45b3762bceb6b6 /drivers/regulator/db8500-prcmu.c | |
parent | 1474e4dbcae04125ed6e503eadcef266846f4675 (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/db8500-prcmu.c')
-rw-r--r-- | drivers/regulator/db8500-prcmu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index 4bd25e75efa0..87b2e83be11c 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c | |||
@@ -414,6 +414,7 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev) | |||
414 | { | 414 | { |
415 | struct regulator_init_data *db8500_init_data = | 415 | struct regulator_init_data *db8500_init_data = |
416 | dev_get_platdata(&pdev->dev); | 416 | dev_get_platdata(&pdev->dev); |
417 | struct regulator_config config = { }; | ||
417 | int i, err; | 418 | int i, err; |
418 | 419 | ||
419 | /* register all regulators */ | 420 | /* register all regulators */ |
@@ -425,9 +426,12 @@ static int __devinit db8500_regulator_probe(struct platform_device *pdev) | |||
425 | info = &dbx500_regulator_info[i]; | 426 | info = &dbx500_regulator_info[i]; |
426 | info->dev = &pdev->dev; | 427 | info->dev = &pdev->dev; |
427 | 428 | ||
429 | config.dev = &pdev->dev; | ||
430 | config.init_data = init_data; | ||
431 | config.driver_data = info; | ||
432 | |||
428 | /* register with the regulator framework */ | 433 | /* register with the regulator framework */ |
429 | info->rdev = regulator_register(&info->desc, &pdev->dev, | 434 | info->rdev = regulator_register(&info->desc, &config); |
430 | init_data, info, NULL); | ||
431 | if (IS_ERR(info->rdev)) { | 435 | if (IS_ERR(info->rdev)) { |
432 | err = PTR_ERR(info->rdev); | 436 | err = PTR_ERR(info->rdev); |
433 | dev_err(&pdev->dev, "failed to register %s: err %i\n", | 437 | dev_err(&pdev->dev, "failed to register %s: err %i\n", |