Skip to content

Commit

Permalink
regulator: max77686: initialize of_node param for regulator register
Browse files Browse the repository at this point in the history
Initialize config.of_node for regulator before registering.
This is needed for DT based regulator support.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Aug 28, 2012
1 parent 7fee2af commit 2c58e26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/regulator/max77686.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
rmatch.of_node = NULL;
of_regulator_match(iodev->dev, regulators_np, &rmatch, 1);
rdata[i].initdata = rmatch.init_data;
rdata[i].of_node = rmatch.of_node;
}

pdata->regulators = rdata;
Expand Down Expand Up @@ -325,6 +326,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev)

for (i = 0; i < MAX77686_REGULATORS; i++) {
config.init_data = pdata->regulators[i].initdata;
config.of_node = pdata->regulators[i].of_node;

rdev[i] = regulator_register(&regulators[i], &config);
if (IS_ERR(rdev[i])) {
Expand Down
1 change: 1 addition & 0 deletions include/linux/mfd/max77686.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ enum max77686_regulators {
struct max77686_regulator_data {
int id;
struct regulator_init_data *initdata;
struct device_node *of_node;
};

enum max77686_opmode {
Expand Down

0 comments on commit 2c58e26

Please sign in to comment.