From: Charles Keepax Date: Mon, 9 Dec 2019 11:09:07 +0000 (+0000) Subject: extcon: arizona: Correct clean up if arizona_identify_headphone fails X-Git-Tag: v5.15~4622^2~8^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9c8eaec8ebe41198b10599f2586750d8900afd97;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Chanwoo Choi --- diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index e970134..79e9a24 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);