Skip to content

Commit

Permalink
regulator: rt5033-regulator: Use regulator_nodes/of_match in the desc…
Browse files Browse the repository at this point in the history
…riptor

This patch is add regulator_nodes/of_match in the regulator descriptor
for using information from DT instead of sppecific codes.

Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Beomho Seo authored and Mark Brown committed Dec 24, 2014
1 parent 97bf6af commit 53aebb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/regulator/rt5033-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ static struct regulator_ops rt5033_buck_ops = {
static const struct regulator_desc rt5033_supported_regulators[] = {
[RT5033_BUCK] = {
.name = "BUCK",
.of_match = of_match_ptr("BUCK"),
.regulators_node = of_match_ptr("regulators"),
.id = RT5033_BUCK,
.ops = &rt5033_buck_ops,
.type = REGULATOR_VOLTAGE,
Expand All @@ -50,6 +52,8 @@ static const struct regulator_desc rt5033_supported_regulators[] = {
},
[RT5033_LDO] = {
.name = "LDO",
.of_match = of_match_ptr("LDO"),
.regulators_node = of_match_ptr("regulators"),
.id = RT5033_LDO,
.ops = &rt5033_buck_ops,
.type = REGULATOR_VOLTAGE,
Expand All @@ -64,6 +68,8 @@ static const struct regulator_desc rt5033_supported_regulators[] = {
},
[RT5033_SAFE_LDO] = {
.name = "SAFE_LDO",
.of_match = of_match_ptr("SAFE_LDO"),
.regulators_node = of_match_ptr("regulators"),
.id = RT5033_SAFE_LDO,
.ops = &rt5033_safe_ldo_ops,
.type = REGULATOR_VOLTAGE,
Expand All @@ -81,7 +87,7 @@ static int rt5033_regulator_probe(struct platform_device *pdev)
int ret, i;
struct regulator_config config = {};

config.dev = &pdev->dev;
config.dev = rt5033->dev;
config.driver_data = rt5033;

for (i = 0; i < ARRAY_SIZE(rt5033_supported_regulators); i++) {
Expand Down

0 comments on commit 53aebb7

Please sign in to comment.