aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/arizona-core.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.wolfsonmicro.com>2014-06-02 04:50:41 -0400
committerLee Jones <lee.jones@linaro.org>2014-07-09 09:58:03 -0400
commite6021511f11e71d0e77e5c31f5b0722a80c3545c (patch)
tree8fb50aae9c56a3d11df51acbb953d0fb5ccb392a /drivers/mfd/arizona-core.c
parentdf6b3352d88560459d4a4926b36409334332f2cb (diff)
mfd: arizona: Don't use devres for DCVDD
Currently the Arizona core uses a devm_regulator_get against its own device node to obtain DCVDD. The Arizona core is an MFD device and DCVDD is usually supplied by a child node (arizona-ldo1) of the core. As devres destruction for the MFD device will run after all its children have been destroyed, the regulator will be destroyed before devres calls regulator_put. This causes a warning from both the destruction of the child node, as the regulator is still open, and from the put of the regulator as the regulator device has already been destroyed. This patch handles the regulator get and put without devres to avoid this issue. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/arizona-core.c')
-rw-r--r--drivers/mfd/arizona-core.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index 9df02502326a..fee6a1ee3a0f 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -683,7 +683,7 @@ int arizona_dev_init(struct arizona *arizona)
683 goto err_early; 683 goto err_early;
684 } 684 }
685 685
686 arizona->dcvdd = devm_regulator_get(arizona->dev, "DCVDD"); 686 arizona->dcvdd = regulator_get(arizona->dev, "DCVDD");
687 if (IS_ERR(arizona->dcvdd)) { 687 if (IS_ERR(arizona->dcvdd)) {
688 ret = PTR_ERR(arizona->dcvdd); 688 ret = PTR_ERR(arizona->dcvdd);
689 dev_err(dev, "Failed to request DCVDD: %d\n", ret); 689 dev_err(dev, "Failed to request DCVDD: %d\n", ret);
@@ -697,7 +697,7 @@ int arizona_dev_init(struct arizona *arizona)
697 "arizona /RESET"); 697 "arizona /RESET");
698 if (ret != 0) { 698 if (ret != 0) {
699 dev_err(dev, "Failed to request /RESET: %d\n", ret); 699 dev_err(dev, "Failed to request /RESET: %d\n", ret);
700 goto err_early; 700 goto err_dcvdd;
701 } 701 }
702 } 702 }
703 703
@@ -706,7 +706,7 @@ int arizona_dev_init(struct arizona *arizona)
706 if (ret != 0) { 706 if (ret != 0) {
707 dev_err(dev, "Failed to enable core supplies: %d\n", 707 dev_err(dev, "Failed to enable core supplies: %d\n",
708 ret); 708 ret);
709 goto err_early; 709 goto err_dcvdd;
710 } 710 }
711 711
712 ret = regulator_enable(arizona->dcvdd); 712 ret = regulator_enable(arizona->dcvdd);
@@ -1015,6 +1015,8 @@ err_reset:
1015err_enable: 1015err_enable:
1016 regulator_bulk_disable(arizona->num_core_supplies, 1016 regulator_bulk_disable(arizona->num_core_supplies,
1017 arizona->core_supplies); 1017 arizona->core_supplies);
1018err_dcvdd:
1019 regulator_put(arizona->dcvdd);
1018err_early: 1020err_early:
1019 mfd_remove_devices(dev); 1021 mfd_remove_devices(dev);
1020 return ret; 1022 return ret;
@@ -1026,6 +1028,7 @@ int arizona_dev_exit(struct arizona *arizona)
1026 pm_runtime_disable(arizona->dev); 1028 pm_runtime_disable(arizona->dev);
1027 1029
1028 regulator_disable(arizona->dcvdd); 1030 regulator_disable(arizona->dcvdd);
1031 regulator_put(arizona->dcvdd);
1029 1032
1030 mfd_remove_devices(arizona->dev); 1033 mfd_remove_devices(arizona->dev);
1031 arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona); 1034 arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona);