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>
This commit is contained in:
Charles Keepax 2019-12-09 11:09:07 +00:00 committed by Chanwoo Choi
parent e42617b825
commit 9c8eaec8eb
1 changed files with 3 additions and 0 deletions

View File

@ -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);