From 17271f608bf818a13b2c235d45258311308d5b03 Mon Sep 17 00:00:00 2001 From: Charles Keepax Date: Fri, 18 Jul 2014 12:59:00 +0100 Subject: extcon: arizona: Get MICVDD against extcon device 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 Signed-off-by: Chanwoo Choi --- drivers/extcon/extcon-arizona.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/extcon') diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index 59aa51309467..ba51588cc000 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); -- cgit v1.2.1