regulator: max77686: initialize of_node param for regulator register
authorAxel Lin <axel.lin@gmail.com>
Sun, 5 Aug 2012 02:09:57 +0000 (10:09 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 28 Aug 2012 18:00:25 +0000 (11:00 -0700)
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>
drivers/regulator/max77686.c
include/linux/mfd/max77686.h

index c564af6f05a360c92f18be7cad558b1b73723c2f..87544b34628ad526cfc9c6fff6033861646b3715 100644 (file)
@@ -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;
@@ -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])) {
index 3d7ae4d7fd3688ab8c5771d710ee5e9803cd7dc9..46c0f320ed764ab33b4dfe9d18ad796c1bfa722f 100644 (file)
@@ -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 {