[alsa-devel] [PATCH 3/3] ASoC: uda1380: Convert to gpio_request_one()
Axel Lin
axel.lin at gmail.com
Sun Dec 4 12:38:53 CET 2011
Signed-off-by: Axel Lin <axel.lin at gmail.com>
---
sound/soc/codecs/uda1380.c | 14 ++++----------
1 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c
index 7ebfbeb..17ae60f 100644
--- a/sound/soc/codecs/uda1380.c
+++ b/sound/soc/codecs/uda1380.c
@@ -732,21 +732,17 @@ static int uda1380_probe(struct snd_soc_codec *codec)
return -EINVAL;
if (gpio_is_valid(pdata->gpio_reset)) {
- ret = gpio_request(pdata->gpio_reset, "uda1380 reset");
+ ret = gpio_request_one(pdata->gpio_reset, GPIOF_OUT_INIT_LOW,
+ "uda1380 reset");
if (ret)
goto err_out;
- ret = gpio_direction_output(pdata->gpio_reset, 0);
- if (ret)
- goto err_gpio_reset_conf;
}
if (gpio_is_valid(pdata->gpio_power)) {
- ret = gpio_request(pdata->gpio_power, "uda1380 power");
+ ret = gpio_request_one(pdata->gpio_power, GPIOF_OUT_INIT_LOW,
+ "uda1380 power");
if (ret)
goto err_gpio;
- ret = gpio_direction_output(pdata->gpio_power, 0);
- if (ret)
- goto err_gpio_power_conf;
}
ret = uda1380_reset(codec);
@@ -775,11 +771,9 @@ static int uda1380_probe(struct snd_soc_codec *codec)
return 0;
err_reset:
-err_gpio_power_conf:
if (gpio_is_valid(pdata->gpio_power))
gpio_free(pdata->gpio_power);
-err_gpio_reset_conf:
err_gpio:
if (gpio_is_valid(pdata->gpio_reset))
gpio_free(pdata->gpio_reset);
--
1.7.5.4
More information about the Alsa-devel
mailing list