diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-10 01:51:06 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-04-10 04:52:53 -0400 |
commit | a9d5801041eecc7baceff49a28e82f91f207a961 (patch) | |
tree | c45260aa9390222926e89a2a34c5d1b6cf1ce21e | |
parent | fe53d18def245f11fe501d403dd08639927c16f3 (diff) |
regulator: Fix build error for mc13783 and mc13892
Convert mc13783 and mc13892 to use a struct to pass in regulator runtime
configuration.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/regulator/mc13783-regulator.c | 12 | ||||
-rw-r--r-- | drivers/regulator/mc13892-regulator.c | 8 |
2 files changed, 15 insertions, 5 deletions
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index 6c0face87ffe..7dcdfa283e93 100644 --- a/drivers/regulator/mc13783-regulator.c +++ b/drivers/regulator/mc13783-regulator.c | |||
@@ -340,6 +340,7 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev) | |||
340 | struct mc13xxx_regulator_platform_data *pdata = | 340 | struct mc13xxx_regulator_platform_data *pdata = |
341 | dev_get_platdata(&pdev->dev); | 341 | dev_get_platdata(&pdev->dev); |
342 | struct mc13xxx_regulator_init_data *init_data; | 342 | struct mc13xxx_regulator_init_data *init_data; |
343 | struct regulator_config config = { }; | ||
343 | int i, ret; | 344 | int i, ret; |
344 | 345 | ||
345 | dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id); | 346 | dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id); |
@@ -357,11 +358,16 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev) | |||
357 | priv->mc13xxx = mc13783; | 358 | priv->mc13xxx = mc13783; |
358 | 359 | ||
359 | for (i = 0; i < pdata->num_regulators; i++) { | 360 | for (i = 0; i < pdata->num_regulators; i++) { |
361 | struct regulator_desc *desc; | ||
362 | |||
360 | init_data = &pdata->regulators[i]; | 363 | init_data = &pdata->regulators[i]; |
361 | priv->regulators[i] = regulator_register( | 364 | desc = &mc13783_regulators[init_data->id].desc; |
362 | &mc13783_regulators[init_data->id].desc, | 365 | |
363 | &pdev->dev, init_data->init_data, priv, NULL); | 366 | config.dev = &pdev->dev; |
367 | config.init_data = init_data->init_data; | ||
368 | config.driver_data = priv; | ||
364 | 369 | ||
370 | priv->regulators[i] = regulator_register(desc, &config); | ||
365 | if (IS_ERR(priv->regulators[i])) { | 371 | if (IS_ERR(priv->regulators[i])) { |
366 | dev_err(&pdev->dev, "failed to register regulator %s\n", | 372 | dev_err(&pdev->dev, "failed to register regulator %s\n", |
367 | mc13783_regulators[i].desc.name); | 373 | mc13783_regulators[i].desc.name); |
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c index ba5868179261..6622228a0d86 100644 --- a/drivers/regulator/mc13892-regulator.c +++ b/drivers/regulator/mc13892-regulator.c | |||
@@ -519,6 +519,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
519 | struct mc13xxx_regulator_platform_data *pdata = | 519 | struct mc13xxx_regulator_platform_data *pdata = |
520 | dev_get_platdata(&pdev->dev); | 520 | dev_get_platdata(&pdev->dev); |
521 | struct mc13xxx_regulator_init_data *mc13xxx_data; | 521 | struct mc13xxx_regulator_init_data *mc13xxx_data; |
522 | struct regulator_config config = { }; | ||
522 | int i, ret; | 523 | int i, ret; |
523 | int num_regulators = 0; | 524 | int num_regulators = 0; |
524 | u32 val; | 525 | u32 val; |
@@ -588,9 +589,12 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev) | |||
588 | } | 589 | } |
589 | desc = &mc13892_regulators[id].desc; | 590 | desc = &mc13892_regulators[id].desc; |
590 | 591 | ||
591 | priv->regulators[i] = regulator_register( | 592 | config.dev = &pdev->dev; |
592 | desc, &pdev->dev, init_data, priv, node); | 593 | config.init_data = init_data; |
594 | config.driver_data = priv; | ||
595 | config.of_node = node; | ||
593 | 596 | ||
597 | priv->regulators[i] = regulator_register(desc, &config); | ||
594 | if (IS_ERR(priv->regulators[i])) { | 598 | if (IS_ERR(priv->regulators[i])) { |
595 | dev_err(&pdev->dev, "failed to register regulator %s\n", | 599 | dev_err(&pdev->dev, "failed to register regulator %s\n", |
596 | mc13892_regulators[i].desc.name); | 600 | mc13892_regulators[i].desc.name); |