Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3966213ybl; Mon, 9 Dec 2019 03:11:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwo2VM6CVR1E8vlZSfjwci25CTtb2O8l0yHXZ/T0Pnh8Skelqpfguvvh8aoJWmFfDg703YM X-Received: by 2002:a9d:7593:: with SMTP id s19mr19993036otk.219.1575889874236; Mon, 09 Dec 2019 03:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575889874; cv=none; d=google.com; s=arc-20160816; b=e3YJgPmA5FFSz2hHITSMvCJak+eWh3pqoFO4FDB3XLQz1AtSXitXqpwfPK+heb4JHm Q8kdf/Yog6fHvMflGxh9HsqdYhtFz2UNyrcHeIZ8OeGjT9EuEVrcQiDwtcdmBz2U6Jx7 2CAnGpdz0jLMLTBtD7gX5smWYyP6AWcFCbJJ3Cx2aMhFdFFepDBBsGWzgA0/s1vEd1kD GT8+1g9WrJn0Y+v/6bwWZhtZhSbVHj4/5COnn1XBDYPI3NUY8frYpf1rVagfQmcPoaMZ npK0V5jja4bvGWWH4PF9wKxrDfJ6SlyXgN+S57BwMMDNzZrYW3oa1KY5pwgNbuiVqQ6M D0/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=d4+Caqw0hJU802CgHU5kAEcGYPQkdHY1suuasB+tLhA=; b=FigaHo+4hLC2qKCmGt9YQiKWxSLoAj5m+2dcg5ONSqX2bnMRKpeHEYUlsv8fkh57Sa 9ASPa79pECC2goexSZILAAGVZUI9JrjUgdhJqc0z9CAwwYAd27Smp4OE6XVAU2KETDBK TyCiEaFG1s0BdEqjElkMwH6wODdNWV6Z1s7q96xxaZBsaMD2F+bi74KKSUJ4TKM0LWnN 3Vwgzc4+U8/WcD4q7lN0ST2YXxW/IVk6NvAbj2GZkGCn169CUdkrafxFkTsEhczGZDwT sAiPJ/nuP6HXPmkn9aUPNKXvotj3UU1UsqnoIftbICJh37Bn0RPNw8Rl+yijNuLzfNF2 L1aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=jsUH8twq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si11337844otl.214.2019.12.09.03.11.01; Mon, 09 Dec 2019 03:11:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=jsUH8twq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=opensource.cirrus.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727682AbfLILJW (ORCPT + 99 others); Mon, 9 Dec 2019 06:09:22 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:1622 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727667AbfLILJV (ORCPT ); Mon, 9 Dec 2019 06:09:21 -0500 Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB9B3UZj022346; Mon, 9 Dec 2019 05:09:18 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=PODMain02222019; bh=d4+Caqw0hJU802CgHU5kAEcGYPQkdHY1suuasB+tLhA=; b=jsUH8twqDBhxJ9MXfbhDN8vPo4RfUNhd1fC4BiTg9/kdNzQFmGRE0RethVHOsaD48Ihb T3uGMSPc3h6reJg6L2b4f2OOmTc15LYd+jPZb2ExSWlJDae+AOSlBpmORMuAhO9cOx4b gVi0QDywM/uZ4tLIs2hy95ctVcE7MTyybvaYN9u7RU0KDIBsg9lh5kUYNFlDX/HWDAYl e3aH2sLApI5BHhznMuwzZlMW45Suj/sDA5illFgFDvmSWCda4RAU1lOShamj4cuWGGW7 DKyk+MrbpH6fyHsX3Q7AOsQ+kE+B+LKru6OGEyv6OaxtDb7TFZIVD1PNNokkfHL65mfq ww== Authentication-Results: ppops.net; spf=fail smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex02.ad.cirrus.com ([5.172.152.52]) by mx0a-001ae601.pphosted.com with ESMTP id 2wrac6j0mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 09 Dec 2019 05:09:18 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 9 Dec 2019 11:09:16 +0000 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.1.1591.10 via Frontend Transport; Mon, 9 Dec 2019 11:09:16 +0000 Received: from algalon.ad.cirrus.com (algalon.ad.cirrus.com [198.90.251.122]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 315EC2C8; Mon, 9 Dec 2019 11:09:16 +0000 (UTC) From: Charles Keepax To: CC: , , Subject: [PATCH 01/10] extcon: arizona: Correct clean up if arizona_identify_headphone fails Date: Mon, 9 Dec 2019 11:09:07 +0000 Message-ID: <20191209110916.29524-1-ckeepax@opensource.cirrus.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-SPF-Result: fail X-Proofpoint-SPF-Record: v=spf1 include:spf-001ae601.pphosted.com include:spf.protection.outlook.com -all X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 lowpriorityscore=0 mlxlogscore=733 spamscore=0 mlxscore=0 clxscore=1015 adultscore=0 impostorscore=0 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912090094 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/extcon/extcon-arizona.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c index e970134c95fab..79e9a24101823 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); -- 2.11.0