diff options
| -rw-r--r-- | drivers/regulator/tps6586x-regulator.c | 14 |
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) { |
