提交 e6021511 编写于 作者: C Charles Keepax 提交者: Lee Jones

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: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
上级 df6b3352
...@@ -683,7 +683,7 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -683,7 +683,7 @@ int arizona_dev_init(struct arizona *arizona)
goto err_early; goto err_early;
} }
arizona->dcvdd = devm_regulator_get(arizona->dev, "DCVDD"); arizona->dcvdd = regulator_get(arizona->dev, "DCVDD");
if (IS_ERR(arizona->dcvdd)) { if (IS_ERR(arizona->dcvdd)) {
ret = PTR_ERR(arizona->dcvdd); ret = PTR_ERR(arizona->dcvdd);
dev_err(dev, "Failed to request DCVDD: %d\n", ret); dev_err(dev, "Failed to request DCVDD: %d\n", ret);
...@@ -697,7 +697,7 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -697,7 +697,7 @@ int arizona_dev_init(struct arizona *arizona)
"arizona /RESET"); "arizona /RESET");
if (ret != 0) { if (ret != 0) {
dev_err(dev, "Failed to request /RESET: %d\n", ret); dev_err(dev, "Failed to request /RESET: %d\n", ret);
goto err_early; goto err_dcvdd;
} }
} }
...@@ -706,7 +706,7 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -706,7 +706,7 @@ int arizona_dev_init(struct arizona *arizona)
if (ret != 0) { if (ret != 0) {
dev_err(dev, "Failed to enable core supplies: %d\n", dev_err(dev, "Failed to enable core supplies: %d\n",
ret); ret);
goto err_early; goto err_dcvdd;
} }
ret = regulator_enable(arizona->dcvdd); ret = regulator_enable(arizona->dcvdd);
...@@ -1015,6 +1015,8 @@ int arizona_dev_init(struct arizona *arizona) ...@@ -1015,6 +1015,8 @@ int arizona_dev_init(struct arizona *arizona)
err_enable: err_enable:
regulator_bulk_disable(arizona->num_core_supplies, regulator_bulk_disable(arizona->num_core_supplies,
arizona->core_supplies); arizona->core_supplies);
err_dcvdd:
regulator_put(arizona->dcvdd);
err_early: err_early:
mfd_remove_devices(dev); mfd_remove_devices(dev);
return ret; return ret;
...@@ -1026,6 +1028,7 @@ int arizona_dev_exit(struct arizona *arizona) ...@@ -1026,6 +1028,7 @@ int arizona_dev_exit(struct arizona *arizona)
pm_runtime_disable(arizona->dev); pm_runtime_disable(arizona->dev);
regulator_disable(arizona->dcvdd); regulator_disable(arizona->dcvdd);
regulator_put(arizona->dcvdd);
mfd_remove_devices(arizona->dev); mfd_remove_devices(arizona->dev);
arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona); arizona_free_irq(arizona, ARIZONA_IRQ_UNDERCLOCKED, arizona);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册