Skip to content

Commit

Permalink
regulator: ab8500: Remove ab8500_regulator_of_probe()
Browse files Browse the repository at this point in the history
Now this is a DT-only driver because non-devicetree probe path is removed,
so merge ab8500_regulator_of_probe() into ab8500_regulator_probe().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Jun 22, 2014
1 parent 7171511 commit a5c1a41
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions drivers/regulator/ab8500.c
Original file line number Diff line number Diff line change
Expand Up @@ -3037,28 +3037,12 @@ static int ab8500_regulator_register(struct platform_device *pdev,
return 0;
}

static int
ab8500_regulator_of_probe(struct platform_device *pdev,
struct device_node *np)
{
struct of_regulator_match *match = abx500_regulator.match;
int err, i;

for (i = 0; i < abx500_regulator.info_size; i++) {
err = ab8500_regulator_register(
pdev, match[i].init_data, i, match[i].of_node);
if (err)
return err;
}

return 0;
}

static int ab8500_regulator_probe(struct platform_device *pdev)
{
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
struct device_node *np = pdev->dev.of_node;
int err;
struct of_regulator_match *match;
int err, i;

if (!ab8500) {
dev_err(&pdev->dev, "null mfd parent\n");
Expand All @@ -3075,7 +3059,16 @@ static int ab8500_regulator_probe(struct platform_device *pdev)
"Error parsing regulator init data: %d\n", err);
return err;
}
return ab8500_regulator_of_probe(pdev, np);

match = abx500_regulator.match;
for (i = 0; i < abx500_regulator.info_size; i++) {
err = ab8500_regulator_register(pdev, match[i].init_data, i,
match[i].of_node);
if (err)
return err;
}

return 0;
}

static int ab8500_regulator_remove(struct platform_device *pdev)
Expand Down

0 comments on commit a5c1a41

Please sign in to comment.