From patchwork Sun Jul 6 17:52:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4490331 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 8F95A9F36A for ; Sun, 6 Jul 2014 17:53:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF4F8202A1 for ; Sun, 6 Jul 2014 17:53:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9FDE3201F5 for ; Sun, 6 Jul 2014 17:53:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 3A704265207; Sun, 6 Jul 2014 19:53:31 +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 B292C2650F2; Sun, 6 Jul 2014 19:53:20 +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 C1E402651D3; Sun, 6 Jul 2014 19:53:19 +0200 (CEST) Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by alsa0.perex.cz (Postfix) with ESMTP id 509432650F2 for ; Sun, 6 Jul 2014 19:52:55 +0200 (CEST) Received: by mail-pd0-f182.google.com with SMTP id y13so4147210pdi.13 for ; Sun, 06 Jul 2014 10:52:54 -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=+DASAHouOUShgs8WbnuX9qQE/Rx70c85Ck0IimB0dRc=; b=W56TJ/XQ2QpHxDlA4tMi04nCVbGAisg8ZCceioOaTFPX5uW+Yk01fkBBMAxW0KU9M+ 1VEO23JAiQ7MbqMqFmDdc1pm7tN93JQvunr8qdbTa0gxU1E70Se5UxrwEqdFP1Q5rS2S izRpj+8TdNr3QRxUoZ7H0ReWwtf7/Df7/Pk//VwPo3A8FQe+auEu03N/gzmXd3la90hQ YljoR2r+nuhnk0BB9pSZgXg79ryngfAhfJHXYUgCpW7vDMTO0g8DTePCykct4Rubn0eA fhQYd02WbG7zwKA/JBaiGlM328dZHGWy/lJLAbHwrzsjjkE94vp0VDlaUbn3Gkl0l7r3 BUJw== X-Received: by 10.70.0.168 with SMTP id 8mr23211452pdf.34.1404669174443; Sun, 06 Jul 2014 10:52:54 -0700 (PDT) Received: from localhost ([122.178.76.19]) by mx.google.com with ESMTPSA id ja8sm50276379pbd.3.2014.07.06.10.52.48 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Jul 2014 10:52:53 -0700 (PDT) Date: Sun, 6 Jul 2014 23:22:44 +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: <4001147a17bf23a80be799234ebb5ef3ad985a5f.1404665589.git.himangi774@gmail.com> 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 5/5] ASoC: pxa/hx4700: 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/hx4700.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 05559a7..b624526 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -198,18 +198,13 @@ static int hx4700_audio_probe(struct platform_device *pdev) if (!machine_is_h4700()) return -ENODEV; - ret = gpio_request_array(hx4700_audio_gpios, - ARRAY_SIZE(hx4700_audio_gpios)); + ret = devm_gpio_request_array(&pdev->dev, hx4700_audio_gpios, + ARRAY_SIZE(hx4700_audio_gpios)); if (ret) return ret; snd_soc_card_hx4700.dev = &pdev->dev; - ret = snd_soc_register_card(&snd_soc_card_hx4700); - if (ret) - gpio_free_array(hx4700_audio_gpios, - ARRAY_SIZE(hx4700_audio_gpios)); - - return ret; + return snd_soc_register_card(&snd_soc_card_hx4700); } static int hx4700_audio_remove(struct platform_device *pdev) @@ -219,7 +214,6 @@ static int hx4700_audio_remove(struct platform_device *pdev) gpio_set_value(GPIO92_HX4700_HP_DRIVER, 0); gpio_set_value(GPIO107_HX4700_SPK_nSD, 0); - gpio_free_array(hx4700_audio_gpios, ARRAY_SIZE(hx4700_audio_gpios)); return 0; }