Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2513675ybc; Sun, 17 Nov 2019 23:38:32 -0800 (PST) X-Google-Smtp-Source: APXvYqwJWPr2gbLECwUzjXWONSGVJDJ6rW25Mhmthgrv3D1j87xXoYhkDSODcQoamRl+6WaCJgrT X-Received: by 2002:a17:906:3157:: with SMTP id e23mr7132609eje.230.1574062712110; Sun, 17 Nov 2019 23:38:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574062712; cv=none; d=google.com; s=arc-20160816; b=EosM2Q5aTUh3B0ffDUbU4z1lglBifI4Yzaa56+4MjKqT71vEdOWoDrYpD3Wje2lkPG OzKurFJK2Z2csMbgwK9CecgDN1k9y2fTHbTfJxsvldp7PRYZUqxfa9u7dXcp8kUDHUvt ljRR0x1Z9XjqSAzJD4vJVM8DCz8vTEuAntaxHcoupwReRiFWbDwUxDWSzu2amqvZI22D 6MCASdikf6xEF4yLsUEpuLDg4f9Bza88ehD5naerU/aMMt2IpPOtutgivIndgrwUtBLz Pvjhh+Falp10uJ/8RV2znjOhM+e1BILS+qxIqpYHNgcoknD+/rWtg5KXjkHhx9T9DXQN MyxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=O2pEQ/gFrO9sbquSpD0RUFiXEZPVde4Gd/3NvXvj/F8=; b=rpvOF6Uiy6qEyF8n90TmWssTkt9cB3DqpBkdKhwS+c4+fO/YelBr48KMpd9XlVACHb VaXYlU1hSNAlkMy1tRlt8Q5TuTe4CJJn/jAdRPN5wM6r9D208ep9CyrVqTtIJnw2nyuc CO+K/QBqKPmNvJirzNMQDJEMV9P7SKBGoWbHTBGzPZeMVsEx+3Q7550mQidWiY8RqNZF R/u9d9Do1RAtL+rJ8sm5aP5fw/s7T24iyu32cNr5L3wrxtZT+DMm1kLKWDL+ZyXuKPvT iNAeXzCn7jHRc53/oQDqhnj+OG76mmjZU4pgHa+lREeV/SuPUTHtFtNpCENjGle1A83F mw2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="lasfj/iU"; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g15si13357288edl.95.2019.11.17.23.38.08; Sun, 17 Nov 2019 23:38:32 -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=fail header.i=@gmail.com header.s=20161025 header.b="lasfj/iU"; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbfKRHgw (ORCPT + 99 others); Mon, 18 Nov 2019 02:36:52 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:43838 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726460AbfKRHgu (ORCPT ); Mon, 18 Nov 2019 02:36:50 -0500 Received: by mail-pj1-f67.google.com with SMTP id a10so1234322pju.10 for ; Sun, 17 Nov 2019 23:36:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O2pEQ/gFrO9sbquSpD0RUFiXEZPVde4Gd/3NvXvj/F8=; b=lasfj/iUysHaMF/qDePjau4redMEkpAtBhX7DCWwsRWWjoMjocxy53+NEzYlRx6r+F eqQDOy6M4w/kJNlBDir5GV7B2JaigQk7H0QKVPSK7M2gIomrHOwulfnCqztEEL6G/k+F T7zpBu/Uw/7zNWTTExlJ4dC0NjILJUqniavbTldNu4ppTZ3oaPyO3RS7l5Y89icjrMnZ /4WyzvHplHa/ygdLd2SvixPvFo1NgnVt+pk/A2J6R40uU80Zbbce2AecXSatp6LWc5c9 IGSnhiCXSLSiMCZlQN4f6XKPDoRRUE6jCcsxilTW/Fdw8qB5t66bpprKEK5tvlf3mB+U L/MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=O2pEQ/gFrO9sbquSpD0RUFiXEZPVde4Gd/3NvXvj/F8=; b=CJwMgsseIXSukl/tgFWbyE6I10/IsE3ow1eWeejYDWFHTO/yWEdxGsimShprb/TKwH hwCREus7dJUWLmokp0kAmZrr5P7aHyR+1wdsfc99EI9p6n4/Lnvy3EpobZZM8hC0RB8z LTZ888BVBIZ1OxXtk1In2JKcPJyjKlhugV4q6K3eMEYR1Z8KQ3/Hld9J8ujcxO9Qu7hp bwh5lzaOFhX9+XIRX0k2AaWh0sbzsMNjbOtMgpImFZApZxtc5JyoKTFr0luJ7klbe27E nQgk3ajzpCjelbUZhtjlgb5FrCPxB3ASXglKQXnAq3rN2sFzT/drje1paMmq6hs9BCy6 GOvA== X-Gm-Message-State: APjAAAUNGBVvRwdbQTY/ghTm9RGphEqWcPBNYTgyld2ScyB3Pn7Z1Xes Tz0IV6aOX/Sy+bkLwOl/WZUx3LK6hDQ= X-Received: by 2002:a17:90a:2470:: with SMTP id h103mr39127468pje.12.1574062609419; Sun, 17 Nov 2019 23:36:49 -0800 (PST) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.gmail.com with ESMTPSA id k13sm18597563pgl.69.2019.11.17.23.36.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 23:36:48 -0800 (PST) From: Chuhong Yuan Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH] ASoC: wm2200: add missed operations in remove and probe failure Date: Mon, 18 Nov 2019 15:36:33 +0800 Message-Id: <20191118073633.28237-1-hslester96@gmail.com> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); 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); return 0; } -- 2.24.0