From patchwork Wed Feb 19 11:07:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 3680291 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D17C5BF13A for ; Wed, 19 Feb 2014 11:08:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B438201D3 for ; Wed, 19 Feb 2014 11:08:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D128820131 for ; Wed, 19 Feb 2014 11:07:59 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E687F265304; Wed, 19 Feb 2014 12:07:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 6541D26530E; Wed, 19 Feb 2014 12:07:38 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 56C9A265467; Wed, 19 Feb 2014 12:07:34 +0100 (CET) Received: from mail-bk0-f47.google.com (mail-bk0-f47.google.com [209.85.214.47]) by alsa0.perex.cz (Postfix) with ESMTP id 3928826530E for ; Wed, 19 Feb 2014 12:07:19 +0100 (CET) Received: by mail-bk0-f47.google.com with SMTP id d7so151152bkh.6 for ; Wed, 19 Feb 2014 03:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=E6BuRRRVSiGBbTCPQSq2yJHRs33hrtEfHaQjdrGAoLg=; b=GcPobw47BT6k+1WHEbCtIv9L4QfiKfgR+PjCinQvkFTbeXSeqWwgxjRdNvYuAh5bDL 1Yh79gpi/BANxC/REEg5Ie/qF30g6rWWNJ8DrV+VvK8vNJ1OOuAajTyBOQyP6oLfC2It gcUGK3gjyDabjleG602Az7bD/PmylL5BzyyApE+YPPx3nqWPxDOk5FPdkZ0spg5jnq0Q 7j/S0VV1ctDPDmTAVGf7wv6EO/FbNddhnMV1JLtlaBLK5Lp5drKAt63EBqLyLujScVnD WPZ9lNptK2We9APm3C5+BZUs1t/duAsz9cVsK32RML6kxRithMb9K3Tfv9IIl5Sl3Jz/ vLMw== X-Received: by 10.204.178.13 with SMTP id bk13mr157254bkb.74.1392808038694; Wed, 19 Feb 2014 03:07:18 -0800 (PST) Received: from tamtam.fritz.box (p5099deeb.dip0.t-ipconnect.de. [80.153.222.235]) by mx.google.com with ESMTPSA id mc2sm205427bkb.12.2014.02.19.03.07.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Feb 2014 03:07:18 -0800 (PST) From: Daniel Mack To: broonie@kernel.org, subaparts@yandex.ru Date: Wed, 19 Feb 2014 12:07:12 +0100 Message-Id: <1392808032-25756-1-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.5.3 Cc: brian.austin@cirrus.com, alsa-devel@alsa-project.org, Paul.Handrigan@cirrus.com, Daniel Mack Subject: [alsa-devel] [PATCH] ASoC: cs4271: free reset gpio in cs4271_remove() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The reset GPIO line is acquired in cs4271_probe(), so it should be freed from cs4271_remove() as well. This way, the driver can unloaded and reloaded more than once. Signed-off-by: Daniel Mack --- sound/soc/codecs/cs4271.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index ce05fd9..aeaa5c6 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c @@ -604,9 +604,11 @@ static int cs4271_remove(struct snd_soc_codec *codec) { struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec); - if (gpio_is_valid(cs4271->gpio_nreset)) + if (gpio_is_valid(cs4271->gpio_nreset)) { /* Set codec to the reset state */ gpio_set_value(cs4271->gpio_nreset, 0); + devm_gpio_free(codec->dev, cs4271->gpio_nreset); + } return 0; };