diff options
author | Bengt Jonsson <bengt.g.jonsson@stericsson.com> | 2010-12-10 05:08:40 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-01-12 09:33:02 -0500 |
commit | cb189b07d57b574cc14382e2130960b0a0193c23 (patch) | |
tree | 8a8d9992e9a2776830989b9acc1301a70d55e349 /drivers/regulator | |
parent | 1394fd2826afb2adf7f6c4833d36a0feba22e665 (diff) |
regulators: Moved define for number of regulators in ab8500
The define for number of regulators is moved from ab8500-core to
ab8500-regulator so that the regulator driver can be updated
independently of ab8500-core. This also changes the platform
configuration structure of ab8500-core so that it contains a
pointer to the regulator_init_data array plus number of
regulators instead of an fixed size array of pointers to
regulator_init_data.
Signed-off-by: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/ab8500.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c index 2f4ec0facef1..5670775f6c9b 100644 --- a/drivers/regulator/ab8500.c +++ b/drivers/regulator/ab8500.c | |||
@@ -370,6 +370,12 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev) | |||
370 | } | 370 | } |
371 | pdata = dev_get_platdata(ab8500->dev); | 371 | pdata = dev_get_platdata(ab8500->dev); |
372 | 372 | ||
373 | /* make sure the platform data has the correct size */ | ||
374 | if (pdata->num_regulator != ARRAY_SIZE(ab8500_regulator_info)) { | ||
375 | dev_err(&pdev->dev, "platform configuration error\n"); | ||
376 | return -EINVAL; | ||
377 | } | ||
378 | |||
373 | /* register all regulators */ | 379 | /* register all regulators */ |
374 | for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) { | 380 | for (i = 0; i < ARRAY_SIZE(ab8500_regulator_info); i++) { |
375 | struct ab8500_regulator_info *info = NULL; | 381 | struct ab8500_regulator_info *info = NULL; |
@@ -380,7 +386,7 @@ static __devinit int ab8500_regulator_probe(struct platform_device *pdev) | |||
380 | info->ab8500 = ab8500; | 386 | info->ab8500 = ab8500; |
381 | 387 | ||
382 | info->regulator = regulator_register(&info->desc, &pdev->dev, | 388 | info->regulator = regulator_register(&info->desc, &pdev->dev, |
383 | pdata->regulator[i], info); | 389 | &pdata->regulator[i], info); |
384 | if (IS_ERR(info->regulator)) { | 390 | if (IS_ERR(info->regulator)) { |
385 | err = PTR_ERR(info->regulator); | 391 | err = PTR_ERR(info->regulator); |
386 | dev_err(&pdev->dev, "failed to register regulator %s\n", | 392 | dev_err(&pdev->dev, "failed to register regulator %s\n", |