aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon/extcon-arizona.c
diff options
context:
space:
mode:
authorCharles Keepax <ckeepax@opensource.cirrus.com>2019-12-09 11:09:07 +0000
committerChanwoo Choi <cw00.choi@samsung.com>2019-12-09 20:18:14 +0900
commit9c8eaec8ebe41198b10599f2586750d8900afd97 (patch)
tree527eb1cf2ec4c71057405ce13c22f6b967ddac30 /drivers/extcon/extcon-arizona.c
parentLinux 5.5-rc1 (diff)
downloadlinux-dev-9c8eaec8ebe41198b10599f2586750d8900afd97.tar.xz
linux-dev-9c8eaec8ebe41198b10599f2586750d8900afd97.zip
extcon: arizona: Correct clean up if arizona_identify_headphone fails
In the error path of arizona_identify_headphone, neither the clamp nor the PM runtime are cleaned up. Add calls to clean up both of these. Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/extcon/extcon-arizona.c')
-rw-r--r--drivers/extcon/extcon-arizona.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index e970134c95fa..79e9a2410182 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -724,6 +724,9 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info)
return;
err:
+ arizona_extcon_hp_clamp(info, false);
+ pm_runtime_put_autosuspend(info->dev);
+
regmap_update_bits(arizona->regmap, ARIZONA_ACCESSORY_DETECT_MODE_1,
ARIZONA_ACCDET_MODE_MASK, ARIZONA_ACCDET_MODE_MIC);