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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 3C7BCC2D0D1 for ; Sun, 29 Dec 2019 17:38:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15F11206DB for ; Sun, 29 Dec 2019 17:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641092; bh=uy6XzSnsfF+rRlYvmuxeFt+VH4vVhWNMPLzSt27uK4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=oeb+HQTTdL3iLifJ9fbzJR9komYYpTO6LhbCrzqk1RwHyJMtUNUo3oVjSSTXf/Rto P9hHK8QFD8H/ip1qlyhZo0eUAX04z26xUj/K29aMz03Q/DJD8aHgfo3MYZ9t9Zv44m 4QroATLa6DGM3rqaG1TIVvSZKCwL6uLBZ/yGPXkw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729711AbfL2Reo (ORCPT ); Sun, 29 Dec 2019 12:34:44 -0500 Received: from mail.kernel.org ([198.145.29.99]:38282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729316AbfL2Ren (ORCPT ); Sun, 29 Dec 2019 12:34:43 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A73AA20722; Sun, 29 Dec 2019 17:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640883; bh=uy6XzSnsfF+rRlYvmuxeFt+VH4vVhWNMPLzSt27uK4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VbKDccZLLdcn5wS0bAL2zp3nomrh8d3ZjrY3JxuilpDfSxzELt0dzfWI1hb8dIw7j nidyFFgNs847YkbABOXoRxOmDIm2Te3uNohakyhEEWLQTZPoosGsuYcMZbx/qYUNck xB4tXNNfbYg0Ydp5mhly4Rx0rXGkHGU6FluZ0+Bg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chuhong Yuan , Mark Brown , Sasha Levin Subject: [PATCH 4.19 171/219] ASoC: wm2200: add missed operations in remove and probe failure Date: Sun, 29 Dec 2019 18:19:33 +0100 Message-Id: <20191229162534.724503078@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162508.458551679@linuxfoundation.org> References: <20191229162508.458551679@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 deff65161504..0a3b746fb909 100644 --- a/sound/soc/codecs/wm2200.c +++ b/sound/soc/codecs/wm2200.c @@ -2413,6 +2413,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); @@ -2429,12 +2431,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