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: 4490311 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 C3C2DBEEAA for ; Sun, 6 Jul 2014 17:52:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1FB7202A1 for ; Sun, 6 Jul 2014 17:52:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id BD12E201F5 for ; Sun, 6 Jul 2014 17:52:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 41367265368; Sun, 6 Jul 2014 19:52:12 +0200 (CEST) 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 89C522650BD; Sun, 6 Jul 2014 19:52:01 +0200 (CEST) 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 901272650C3; Sun, 6 Jul 2014 19:51:59 +0200 (CEST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by alsa0.perex.cz (Postfix) with ESMTP id 4615F265086 for ; Sun, 6 Jul 2014 19:51:51 +0200 (CEST) Received: by mail-pa0-f48.google.com with SMTP id et14so4159496pad.7 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 Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Julia Lawall Subject: [alsa-devel] [PATCH 4/5] ASoC: pxa: e800_wm9712: Introduce the use of devm_gpio_request_array 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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; }