From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D935C2D0BF for ; Tue, 10 Dec 2019 21:17:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 191C9205C9 for ; Tue, 10 Dec 2019 21:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576012639; bh=2jmLvshvkcZRQ15mLsyjwl2ryVz5NqiA9+p1Nim49Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=o7u/LygL4NO0MXoIjB9sOHS457JMpPoLBdSwEnYgp37Lnx7gkvxxYib6x8Ym7cCZJ zieHqgYlAXHcYevT067xOf9HW07w67rVqdTrjhLgF7JUXhK0q7AVjoQylfdGk/24nV zerx3rw0TWZEIg5Z0efJ/zE1NZlvmgOksdgQ5NRs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729282AbfLJVRS (ORCPT ); Tue, 10 Dec 2019 16:17:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:38530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729153AbfLJVM6 (ORCPT ); Tue, 10 Dec 2019 16:12:58 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6863222464; Tue, 10 Dec 2019 21:12:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576012378; bh=2jmLvshvkcZRQ15mLsyjwl2ryVz5NqiA9+p1Nim49Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hm8Gk2vfg72U2OfC7/vaGf0BNXtfz6a6QWYaWePcbeVFMWob/ZRkCD6Db+55LypW7 /ePVhPjrhQYtpBmZs87QnfwXsZKDlba7NFa770Wbe/WmeWtN1zTdMoMkKnShgQphkH 0Rq+LfxxT2gjLAUymz65mu0dZUpoAetFJLOD06L0= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chuhong Yuan , Mark Brown , Sasha Levin , patches@opensource.cirrus.com, alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.4 302/350] ASoC: wm2200: add missed operations in remove and probe failure Date: Tue, 10 Dec 2019 16:06:47 -0500 Message-Id: <20191210210735.9077-263-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191210210735.9077-1-sashal@kernel.org> References: <20191210210735.9077-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan [ Upstream commit 2dab09be49a1e7a4dd13cb47d3a1441a2ef33a87 ] 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 Link: https://lore.kernel.org/r/20191118073633.28237-1-hslester96@gmail.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- 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 cf64e109c6587..7b087d94141bd 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.20.1