From patchwork Sun Jul 6 17:49:48 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4490271 Return-Path: X-Original-To: patchwork-alsa-devel@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 D66859F36A for ; Sun, 6 Jul 2014 17:50:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 17B98202EC for ; Sun, 6 Jul 2014 17:50:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id EBFBB202A1 for ; Sun, 6 Jul 2014 17:50:13 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 077F626510A; Sun, 6 Jul 2014 19:50:13 +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 9BD682650BD; Sun, 6 Jul 2014 19:50:07 +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 39A7A2650C3; Sun, 6 Jul 2014 19:50:06 +0200 (CEST) Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by alsa0.perex.cz (Postfix) with ESMTP id A2515265086 for ; Sun, 6 Jul 2014 19:49:57 +0200 (CEST) Received: by mail-pd0-f180.google.com with SMTP id fp1so4128672pdb.39 for ; Sun, 06 Jul 2014 10:49:56 -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=9vPBpsVGwdtMua66WvRMU1q6AOQwNcRggFcshRsfHNI=; b=Sirw6UrtQIOuMBDcS20BsvaUrJgeRMcUeUXIIN4NsR6wp9/nHigJgkysscPkB+Fvc8 0Lw5GOILSOuWykB8ZG4ts7tbb0uc1Er1LJIjY/53c39BRW2cA/FNQkmQpu+LNPaf9sm7 G9wkM/IdColH4crLCHhKInUEtWIGG2Bfi6vHTWNsOcP58cWQ/is+ZXqi1Sv9qd/zHF6w rcGmeGpMZ0OwAtYoT/YqkueT/umY9jPxr0U7xc8KJvi/7DHujDzbUw2R/njtMQj9B5WF fx4azdIA9TYABhbt4B8mCTMzLq2c1arHT/udX5z9ZU/N1UKVwMuyOy/Brb4MgcCK2tjB Ni5Q== X-Received: by 10.66.102.4 with SMTP id fk4mr23989133pab.59.1404668996792; Sun, 06 Jul 2014 10:49:56 -0700 (PDT) Received: from localhost ([122.178.76.19]) by mx.google.com with ESMTPSA id pr8sm50216943pbc.74.2014.07.06.10.49.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Jul 2014 10:49:55 -0700 (PDT) Date: Sun, 6 Jul 2014 23:19:48 +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@lip6.fr Subject: [alsa-devel] [PATCH 3/5] ASoC: pxa: Use 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 data 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/e740_wm9705.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/soc/pxa/e740_wm9705.c b/sound/soc/pxa/e740_wm9705.c index c29feda..d462dc9 100644 --- a/sound/soc/pxa/e740_wm9705.c +++ b/sound/soc/pxa/e740_wm9705.c @@ -149,19 +149,17 @@ static int e740_probe(struct platform_device *pdev) struct snd_soc_card *card = &e740; int ret; - ret = gpio_request_array(e740_audio_gpios, - ARRAY_SIZE(e740_audio_gpios)); + ret = devm_gpio_request_array(&pdev->dev, e740_audio_gpios, + ARRAY_SIZE(e740_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(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios)); - } return ret; } @@ -169,7 +167,6 @@ static int e740_remove(struct platform_device *pdev) { struct snd_soc_card *card = platform_get_drvdata(pdev); - gpio_free_array(e740_audio_gpios, ARRAY_SIZE(e740_audio_gpios)); snd_soc_unregister_card(card); return 0; }