regulator: axp20x: Use parent device as regulator configuration device
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Sat, 20 Sep 2014 20:06:34 +0000 (22:06 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 23 Sep 2014 01:18:59 +0000 (18:18 -0700)
The current device used for the regulator configuration is the child device
created by the MFD driver. This means that it doesn't have any of_node pointing
to it, and whenever we register the regulators, it will not look into the
regulator supply in the DT, hence requiring to provide regulator aliases in the
MFD driver.

We can easily fix that by using the parent device in our configuration, which
has a DT node associated to it, and will allow a DT lookup. Eventually, we will
be able to remove the aliases in the MFD driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/axp20x-regulator.c

index 004aadb7bcc10ec5773a5f3f21294c66eac3862d..2e1010a34ddcdd0bb47c42575b9c17fc0b05e6be 100644 (file)
@@ -245,7 +245,7 @@ static int axp20x_regulator_probe(struct platform_device *pdev)
        for (i = 0; i < AXP20X_REG_ID_MAX; i++) {
                init_data = axp20x_matches[i].init_data;
 
-               config.dev = &pdev->dev;
+               config.dev = pdev->dev.parent;
                config.init_data = init_data;
                config.regmap = axp20x->regmap;
                config.of_node = axp20x_matches[i].of_node;