aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-03-08 08:15:59 -0500
committerMark Brown <broonie@linaro.org>2014-03-13 07:42:23 -0400
commitd6fe2c7251e47d2aa4006e73da4f518f4f6f9e74 (patch)
tree8a0d65485daeb266ae22b67a86cb87bd1c6458e9 /drivers/regulator
parent02e905845fb722be50d605bdcb277bad6a6bfe66 (diff)
regulator: tps6586x: Remove unnecessary rdev[] array
Now we are using devm_regulator_register(), so we don't need the rdev[] array to store return value of devm_regulator_register. Use a *rdev variable is enough for checking return status. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps6586x-regulator.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c
index e36f3569767f..32f38a63d944 100644
--- a/drivers/regulator/tps6586x-regulator.c
+++ b/drivers/regulator/tps6586x-regulator.c
@@ -396,7 +396,7 @@ static int tps6586x_regulator_probe(struct platform_device *pdev)
396{ 396{
397 struct tps6586x_regulator *ri = NULL; 397 struct tps6586x_regulator *ri = NULL;
398 struct regulator_config config = { }; 398 struct regulator_config config = { };
399 struct regulator_dev **rdev; 399 struct regulator_dev *rdev;
400 struct regulator_init_data *reg_data; 400 struct regulator_init_data *reg_data;
401 struct tps6586x_platform_data *pdata; 401 struct tps6586x_platform_data *pdata;
402 struct of_regulator_match *tps6586x_reg_matches = NULL; 402 struct of_regulator_match *tps6586x_reg_matches = NULL;
@@ -416,11 +416,6 @@ static int tps6586x_regulator_probe(struct platform_device *pdev)
416 return -ENODEV; 416 return -ENODEV;
417 } 417 }
418 418
419 rdev = devm_kzalloc(&pdev->dev, TPS6586X_ID_MAX_REGULATOR *
420 sizeof(*rdev), GFP_KERNEL);
421 if (!rdev)
422 return -ENOMEM;
423
424 version = tps6586x_get_version(pdev->dev.parent); 419 version = tps6586x_get_version(pdev->dev.parent);
425 420
426 for (id = 0; id < TPS6586X_ID_MAX_REGULATOR; ++id) { 421 for (id = 0; id < TPS6586X_ID_MAX_REGULATOR; ++id) {
@@ -447,12 +442,11 @@ static int tps6586x_regulator_probe(struct platform_device *pdev)
447 if (tps6586x_reg_matches) 442 if (tps6586x_reg_matches)
448 config.of_node = tps6586x_reg_matches[id].of_node; 443 config.of_node = tps6586x_reg_matches[id].of_node;
449 444
450 rdev[id] = devm_regulator_register(&pdev->dev, &ri->desc, 445 rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config);
451 &config); 446 if (IS_ERR(rdev)) {
452 if (IS_ERR(rdev[id])) {
453 dev_err(&pdev->dev, "failed to register regulator %s\n", 447 dev_err(&pdev->dev, "failed to register regulator %s\n",
454 ri->desc.name); 448 ri->desc.name);
455 return PTR_ERR(rdev[id]); 449 return PTR_ERR(rdev);
456 } 450 }
457 451
458 if (reg_data) { 452 if (reg_data) {