From patchwork Sun Jul 6 17:48:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: HIMANGI SARAOGI X-Patchwork-Id: 4490241 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 8A2649F36A for ; Sun, 6 Jul 2014 17:49:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDF8C202E6 for ; Sun, 6 Jul 2014 17:49:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 9C17A200CF for ; Sun, 6 Jul 2014 17:49:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id B64952651C8; Sun, 6 Jul 2014 19:49: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 CBAFD2650BD; Sun, 6 Jul 2014 19:49:02 +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 B92FA2650C3; Sun, 6 Jul 2014 19:49:01 +0200 (CEST) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by alsa0.perex.cz (Postfix) with ESMTP id 7B22B2650BD for ; Sun, 6 Jul 2014 19:48:53 +0200 (CEST) Received: by mail-pa0-f52.google.com with SMTP id eu11so4184556pac.39 for ; Sun, 06 Jul 2014 10:48:52 -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=JsU0sq1/dqD5N3i/3SJ8vIG6pvXxl3e2zcp9zFn8Z24=; b=PhMdYa/fCKS6aUsqaf+vGMNyypKLqxUBOdZ7uHy2t233+4GkrGJvV2bGQY26wXg+FF KGGtljWe4PG64mPrt/qJjfHIIbvZvMKi2Z/LeH29cx9uyF/2fCzqnbqfxbCcpqu3nrEg SQHzexRxZBIGz5nzKR+7dCfiSgB09O98sXEWGJf+adXEObFaF2CZdgCmHdjKYXIwFjJu yVR20ezPodmvlq9QnAqHBis19xCnAz7p2KdU7wNm0tFmEyToFG/szpeLOUDy9uRHWtgG 0oAdwvXkUj/f+ApGLkJdlICMCczjMNqJt6TvJHhP/RciRQAtsS6Xyrgu1RpNokTQ6d+y L4BA== X-Received: by 10.67.4.163 with SMTP id cf3mr23495769pad.92.1404668932298; Sun, 06 Jul 2014 10:48:52 -0700 (PDT) Received: from localhost ([122.178.76.19]) by mx.google.com with ESMTPSA id y8sm17069758pdo.24.2014.07.06.10.48.45 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 06 Jul 2014 10:48:50 -0700 (PDT) Date: Sun, 6 Jul 2014 23:18:42 +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 2/5] ASoC: wm1250-ev1: 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 replaces a call to the unmanaged function gpio_request_array by a call to the managed function devm_gpio_request_array and removes the calls to gpio_free_array in wm1250_ev1_pdata, which is called by the probe function. The function wm1250_ev1_free is no longer needed and is removed. Signed-off-by: Himangi Saraogi --- sound/soc/codecs/wm1250-ev1.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/sound/soc/codecs/wm1250-ev1.c b/sound/soc/codecs/wm1250-ev1.c index 8011f75..44534e6 100644 --- a/sound/soc/codecs/wm1250-ev1.c +++ b/sound/soc/codecs/wm1250-ev1.c @@ -176,7 +176,8 @@ static int wm1250_ev1_pdata(struct i2c_client *i2c) wm1250->gpios[WM1250_EV1_GPIO_CLK_SEL0].flags = GPIOF_OUT_INIT_HIGH; wm1250->gpios[WM1250_EV1_GPIO_CLK_SEL1].flags = GPIOF_OUT_INIT_HIGH; - ret = gpio_request_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios)); + ret = devm_gpio_request_array(&i2c->dev, wm1250->gpios, + ARRAY_SIZE(wm1250->gpios)); if (ret != 0) { dev_err(&i2c->dev, "Failed to get GPIOs: %d\n", ret); goto err; @@ -190,14 +191,6 @@ err: return ret; } -static void wm1250_ev1_free(struct i2c_client *i2c) -{ - struct wm1250_priv *wm1250 = dev_get_drvdata(&i2c->dev); - - if (wm1250) - gpio_free_array(wm1250->gpios, ARRAY_SIZE(wm1250->gpios)); -} - static int wm1250_ev1_probe(struct i2c_client *i2c, const struct i2c_device_id *i2c_id) { @@ -229,7 +222,6 @@ static int wm1250_ev1_probe(struct i2c_client *i2c, &wm1250_ev1_dai, 1); if (ret != 0) { dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); - wm1250_ev1_free(i2c); return ret; } @@ -239,7 +231,6 @@ static int wm1250_ev1_probe(struct i2c_client *i2c, static int wm1250_ev1_remove(struct i2c_client *i2c) { snd_soc_unregister_codec(&i2c->dev); - wm1250_ev1_free(i2c); return 0; }