From patchwork Sun Jul 6 17:51:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4490341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 45AC29F36A for ; Sun, 6 Jul 2014 17:54:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C6FB202A1 for ; Sun, 6 Jul 2014 17:54:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B4FE0201F5 for ; Sun, 6 Jul 2014 17:54:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1X3qbm-00049M-Mb; Sun, 06 Jul 2014 17:52:14 +0000 Received: from mail-pa0-x22c.google.com ([2607:f8b0:400e:c03::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X3qbk-0003yw-9p for linux-arm-kernel@lists.infradead.org; Sun, 06 Jul 2014 17:52:12 +0000 Received: by mail-pa0-f44.google.com with SMTP id rd3so4209580pab.3 for ; Sun, 06 Jul 2014 10:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=7W+YhyjRWtp/jDNiEIZauf0ENs4gyDlx3m2dopOJfDc=; b=t1lw4j9k9i6v9lJNEGSkXJH3XUZCGj5YQzsksQnocpGVKyFfszKAJJb+F4h1MOkLD9 36GAoaHbjicXSnxUl/bIL+ckR069glxOmrs6jx3+ZlifcwtA5Y94Sre7Sszl8ugHt8oM yjwnOKnQidVcMpUTeVR0gBgYbquT0FlqaAVk1jM5o8axqtxxd4ynxZ00PYiG5zXAw9Gl V2CZuobjuxRbKhjVFw/iNfbvB3BOn97OMdTOnyUkgeFaRAGqWuk6Noai0iObJXdEL1b9 LyB7yYn+jB4TiiDQzYXt3hRvJNC8vWzKbAV6b8jLBKn9+7pfS8spo6aUNOPgjVRpb2YI xYjA== X-Received: by 10.66.150.228 with SMTP id ul4mr24218689pab.16.1404669110327; Sun, 06 Jul 2014 10:51:50 -0700 (PDT) Received: from localhost ([122.178.76.19]) by mx.google.com with ESMTPSA id xt7sm24313248pab.0.2014.07.06.10.51.44 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Jul 2014 10:51:49 -0700 (PDT) Date: Sun, 6 Jul 2014 23:21:41 +0530 From: Himangi Saraogi To: Linus Walleij , Alexandre Courbot , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Randy Dunlap , linux-doc@vger.kernel.org, Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , patches@opensource.wolfsonmicro.com, alsa-devel@alsa-project.org, Eric Miao , Russell King , Haojian Zhuang , linux-arm-kernel@lists.infradead.org, Philipp Zabel , Paul Parsons Subject: [PATCH 4/5] ASoC: pxa: e800_wm9712: Introduce the use of devm_gpio_request_array Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140706_105212_391013_25E1D3B6 X-CRM114-Status: GOOD ( 15.11 ) X-Spam-Score: -0.6 (/) Cc: Julia Lawall X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch moves the resources allocated using gpio_request_array to the managed interface and removes the calls to gpio_free_array in the probe and remove functions. Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- sound/soc/pxa/e800_wm9712.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/pxa/e800_wm9712.c b/sound/soc/pxa/e800_wm9712.c index 24c2078..dbc3670 100644 --- a/sound/soc/pxa/e800_wm9712.c +++ b/sound/soc/pxa/e800_wm9712.c @@ -112,19 +112,17 @@ static int e800_probe(struct platform_device *pdev) struct snd_soc_card *card = &e800; int ret; - ret = gpio_request_array(e800_audio_gpios, - ARRAY_SIZE(e800_audio_gpios)); + ret = devm_gpio_request_array(&pdev->dev, e800_audio_gpios, + ARRAY_SIZE(e800_audio_gpios)); if (ret) return ret; card->dev = &pdev->dev; ret = snd_soc_register_card(card); - if (ret) { + if (ret) dev_err(&pdev->dev, "snd_soc_register_card() failed: %d\n", ret); - gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios)); - } return ret; } @@ -132,7 +130,6 @@ static int e800_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); - gpio_free_array(e800_audio_gpios, ARRAY_SIZE(e800_audio_gpios)); snd_soc_unregister_card(card); return 0; }