Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752075AbaGFRsy (ORCPT ); Sun, 6 Jul 2014 13:48:54 -0400 Received: from mail-pa0-f48.google.com ([209.85.220.48]:33696 "EHLO mail-pa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751889AbaGFRsw (ORCPT ); Sun, 6 Jul 2014 13:48:52 -0400 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 Cc: julia.lawall@lip6.fr Subject: [PATCH 2/5] ASoC: wm1250-ev1: Use devm_gpio_request_array Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/