Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2743488ybc; Mon, 18 Nov 2019 04:04:08 -0800 (PST) X-Google-Smtp-Source: APXvYqweTwZF7XXuf5VahxQZkKvbC6Ze6e65vOG5/t9u2Kgt75kvxGrv7eCFHvPw0WfsnGd8DAmY X-Received: by 2002:a2e:9104:: with SMTP id m4mr6713718ljg.63.1574078648294; Mon, 18 Nov 2019 04:04:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574078648; cv=none; d=google.com; s=arc-20160816; b=i3pNzN5JxoIUl3DVWesJeoFrXY+cJ1TdDJ0SnmIvzeSgOT0Glj+m2b5KqMVCZuPyzb cdN+MzNCDED5YTM/08QA7WqJHwfmQ2s0O6pEn2VA4HuLxEcVmZx1BZ2JHySSjQ0aJulF M20UDb+vhfuiSnfIkVTmx6FQuKhExDQzDVMnynf9lESvcFam2ccWkNeX/A8pr9x3nyD2 4UZ/YXmWa46y34JRjIP0zvOUqVE4YjMv8OiXiVpPYn5awhOXDLijlOAhkLzGWf2Oj4B1 23bxoh2r/Q+JNWLDDiUK7kpcimIAutfrTZG59EdY9UB9zK05L90ZHkhKo3og4b18FsIu vPCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=a90LFI+4UGRRN7SiN+NnHb60zo8aNl0u0NCeb9mxiHk=; b=H9nKFanoy1lGJnkU1FQKjAlYzK1XZMoqBCV7XwYaAL7v9pNdgXk1Aq0XJAxyjoXwR0 TbBjlW+FWH/YxxfqdNhU9rtry6Kx6kDtXVZeZWtrEvzHxIRHWkWO+RmwX9bzHST1HvHE 1U53OG4yWFzEGOTg6d6eP8tyEmojeSItGetUiK7O79Ngix54Q1bfOS4rj5IIIAw27QGi +Z8oKkZ+KDi7ddo2Z2Nz6YI21OOknaLHWaq2A0n7raCWn3W3K9jS2TFyyJ6FGIGZKUP2 kGgXtOz34hw8QE0QPU5baFeWGlfj6mpSH8OUWpQ66SYptZFvSFZDzhuvymulNyCSJlOA 9sHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cirrus.com header.s=PODMain02222019 header.b=AME6hCYH; 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 d10si12047773edp.264.2019.11.18.04.03.43; Mon, 18 Nov 2019 04:04:08 -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=AME6hCYH; 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 S1726865AbfKRMAA (ORCPT + 99 others); Mon, 18 Nov 2019 07:00:00 -0500 Received: from mx0a-001ae601.pphosted.com ([67.231.149.25]:16066 "EHLO mx0b-001ae601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726506AbfKRL77 (ORCPT ); Mon, 18 Nov 2019 06:59:59 -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 xAIBsbju014603; Mon, 18 Nov 2019 05:57:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=PODMain02222019; bh=a90LFI+4UGRRN7SiN+NnHb60zo8aNl0u0NCeb9mxiHk=; b=AME6hCYHgFoi0so5ng3/aZ9wLRPM0wv8J2BwCeJTZG1j97yGsixViaaHImVHmjKErj/V /yz5WiIuZPyqTatpNGCt1ihqyAgCgWsG18tPf1vzLd98824To4FwNYBmfFWPxLPS7Msv mPdXoJY4xsQKIHr+t+M4tmahSXAGZCCKs0dRGxwkwVucrG2WaKHE13Sduyo8xAy7SW8G nyjRZm9Tb/64Pb6C7ptlkXJneP3mfCE7l5eFpvXUNdQPUwe5kjv4kZFHCcrOBTcNP5nF 1XKpeA4XRhyb5DlCikLQJ/vreHfCNF0WgQuJywb+7bSDGr2KR6qHR4fE3yR5VDFPC6Yl XA== Authentication-Results: ppops.net; spf=fail smtp.mailfrom=ckeepax@opensource.cirrus.com Received: from ediex01.ad.cirrus.com ([87.246.76.36]) by mx0a-001ae601.pphosted.com with ESMTP id 2wafd6teh6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT); Mon, 18 Nov 2019 05:57:50 -0600 Received: from EDIEX01.ad.cirrus.com (198.61.84.80) by EDIEX01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 18 Nov 2019 11:57:48 +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, 18 Nov 2019 11:57:48 +0000 Received: from ediswmail.ad.cirrus.com (ediswmail.ad.cirrus.com [198.61.86.93]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id F17672C6; Mon, 18 Nov 2019 11:57:47 +0000 (UTC) Date: Mon, 18 Nov 2019 11:57:47 +0000 From: Charles Keepax To: Chuhong Yuan CC: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , , , Subject: Re: [PATCH] ASoC: wm2200: add missed operations in remove and probe failure Message-ID: <20191118115747.GG10439@ediswmail.ad.cirrus.com> References: <20191118073633.28237-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20191118073633.28237-1-hslester96@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 mlxscore=0 clxscore=1015 adultscore=0 impostorscore=0 suspectscore=2 bulkscore=0 priorityscore=1501 phishscore=0 malwarescore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1911180108 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 18, 2019 at 03:36:33PM +0800, Chuhong Yuan wrote: > This driver misses calls to pm_runtime_disable and regulator_bulk_disable > in remove and a call to free_irq in probe failure. > Add the calls to fix it. > > Signed-off-by: Chuhong Yuan > --- > sound/soc/codecs/wm2200.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/sound/soc/codecs/wm2200.c b/sound/soc/codecs/wm2200.c > index cf64e109c658..7b087d94141b 100644 > --- a/sound/soc/codecs/wm2200.c > +++ b/sound/soc/codecs/wm2200.c > @@ -2410,6 +2410,8 @@ static int wm2200_i2c_probe(struct i2c_client *i2c, > > err_pm_runtime: > pm_runtime_disable(&i2c->dev); > + if (i2c->irq) > + free_irq(i2c->irq, wm2200); Might be worth also adding a return if the request of the IRQ fails. We will get a large WARN in the log if the IRQ request failed, then we fall down this error path. > err_reset: > if (wm2200->pdata.reset) > gpio_set_value_cansleep(wm2200->pdata.reset, 0); > @@ -2426,12 +2428,15 @@ static int wm2200_i2c_remove(struct i2c_client *i2c) > { > struct wm2200_priv *wm2200 = i2c_get_clientdata(i2c); > > + pm_runtime_disable(&i2c->dev); > if (i2c->irq) > free_irq(i2c->irq, wm2200); > if (wm2200->pdata.reset) > gpio_set_value_cansleep(wm2200->pdata.reset, 0); > if (wm2200->pdata.ldo_ena) > gpio_set_value_cansleep(wm2200->pdata.ldo_ena, 0); > + regulator_bulk_disable(ARRAY_SIZE(wm2200->core_supplies), > + wm2200->core_supplies); This one is a bit trickier since this regulator is being controlled by PM runtime, and I don't think it necessarily leaves things in an enabled state when it is disabled. Thanks, Charles