* [PATCH] extcon: arizona: Get MICVDD against extcon device
@ 2014-07-18 11:59 Charles Keepax
2014-07-22 5:12 ` Chanwoo Choi
0 siblings, 1 reply; 2+ messages in thread
From: Charles Keepax @ 2014-07-18 11:59 UTC (permalink / raw)
To: cw00.choi; +Cc: myungjoo.ham, patches, linux-kernel
Previously we would do a regulator get against the main Arizona device
to obtain the MICVDD regulator. Arizona is an MFD device and normally
MICVDD will be supplied by one of its children (the arizona-micsupp
regulator). 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.
A simple fix here is to get the regulator against the extcon device
itself such that devres runs when the child is destroyed. This has the
additional benefit that if for some reason the extcon driver is unloaded
the regulator reference won't hang around until the MFD is unloaded.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
drivers/extcon/extcon-arizona.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 59aa513..ba51588 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -1120,7 +1120,7 @@ static int arizona_extcon_probe(struct platform_device *pdev)
if (!info)
return -ENOMEM;
- info->micvdd = devm_regulator_get(arizona->dev, "MICVDD");
+ info->micvdd = devm_regulator_get(&pdev->dev, "MICVDD");
if (IS_ERR(info->micvdd)) {
ret = PTR_ERR(info->micvdd);
dev_err(arizona->dev, "Failed to get MICVDD: %d\n", ret);
--
1.7.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: arizona: Get MICVDD against extcon device
2014-07-18 11:59 [PATCH] extcon: arizona: Get MICVDD against extcon device Charles Keepax
@ 2014-07-22 5:12 ` Chanwoo Choi
0 siblings, 0 replies; 2+ messages in thread
From: Chanwoo Choi @ 2014-07-22 5:12 UTC (permalink / raw)
To: Charles Keepax; +Cc: myungjoo.ham, patches, linux-kernel
On 07/18/2014 08:59 PM, Charles Keepax wrote:
> Previously we would do a regulator get against the main Arizona device
> to obtain the MICVDD regulator. Arizona is an MFD device and normally
> MICVDD will be supplied by one of its children (the arizona-micsupp
> regulator). 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.
>
> A simple fix here is to get the regulator against the extcon device
> itself such that devres runs when the child is destroyed. This has the
> additional benefit that if for some reason the extcon driver is unloaded
> the regulator reference won't hang around until the MFD is unloaded.
>
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Applied now, Thanks.
Chanwoo Choi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-22 5:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 11:59 [PATCH] extcon: arizona: Get MICVDD against extcon device Charles Keepax
2014-07-22 5:12 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox