Skip to content

Commit

Permalink
regulator: tps65218: Add OF dependency
Browse files Browse the repository at this point in the history
This is a DT-only driver, so make it depend on OF and remove of_match_ptr in
the code.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Keerthy <j-keerthy@ti.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Axel Lin authored and Mark Brown committed Feb 19, 2014
1 parent 413be59 commit 948838a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion drivers/regulator/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ config REGULATOR_TPS65217

config REGULATOR_TPS65218
tristate "TI TPS65218 Power regulators"
depends on MFD_TPS65218
depends on MFD_TPS65218 && OF
help
This driver supports TPS65218 voltage regulator chips. TPS65218
provides six step-down converters and one general-purpose LDO
Expand Down
14 changes: 6 additions & 8 deletions drivers/regulator/tps65218-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,12 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
int id;

match = of_match_device(tps65218_of_match, &pdev->dev);
if (match) {
template = match->data;
id = template->id;
init_data = of_get_regulator_init_data(&pdev->dev,
pdev->dev.of_node);
} else {
if (!match)
return -ENODEV;
}

template = match->data;
id = template->id;
init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);

platform_set_drvdata(pdev, tps);

Expand All @@ -274,7 +272,7 @@ static struct platform_driver tps65218_regulator_driver = {
.driver = {
.name = "tps65218-pmic",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(tps65218_of_match),
.of_match_table = tps65218_of_match,
},
.probe = tps65218_regulator_probe,
};
Expand Down

0 comments on commit 948838a

Please sign in to comment.