Commit 2c58e266 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: max77686: initialize of_node param for regulator register

Initialize config.of_node for regulator before registering.
This is needed for DT based regulator support.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 7fee2afb
...@@ -265,6 +265,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev, ...@@ -265,6 +265,7 @@ static int max77686_pmic_dt_parse_pdata(struct max77686_dev *iodev,
rmatch.of_node = NULL; rmatch.of_node = NULL;
of_regulator_match(iodev->dev, regulators_np, &rmatch, 1); of_regulator_match(iodev->dev, regulators_np, &rmatch, 1);
rdata[i].initdata = rmatch.init_data; rdata[i].initdata = rmatch.init_data;
rdata[i].of_node = rmatch.of_node;
} }
pdata->regulators = rdata; pdata->regulators = rdata;
...@@ -325,6 +326,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) ...@@ -325,6 +326,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev)
for (i = 0; i < MAX77686_REGULATORS; i++) { for (i = 0; i < MAX77686_REGULATORS; i++) {
config.init_data = pdata->regulators[i].initdata; config.init_data = pdata->regulators[i].initdata;
config.of_node = pdata->regulators[i].of_node;
rdev[i] = regulator_register(&regulators[i], &config); rdev[i] = regulator_register(&regulators[i], &config);
if (IS_ERR(rdev[i])) { if (IS_ERR(rdev[i])) {
......
...@@ -74,6 +74,7 @@ enum max77686_regulators { ...@@ -74,6 +74,7 @@ enum max77686_regulators {
struct max77686_regulator_data { struct max77686_regulator_data {
int id; int id;
struct regulator_init_data *initdata; struct regulator_init_data *initdata;
struct device_node *of_node;
}; };
enum max77686_opmode { enum max77686_opmode {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment