All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_reset
@ 2010-11-01 12:03 Jarkko Nikula
  2010-11-01 12:03 ` [PATCH 2/2] ASoC: tlv320aic3x: Add support to shared common reset line Jarkko Nikula
  2010-11-01 13:07 ` [PATCH 1/2] ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_reset Mark Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Jarkko Nikula @ 2010-11-01 12:03 UTC (permalink / raw)
  To: alsa-devel; +Cc: Mark Brown, Liam Girdwood

I promised to convert this at some point.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
---
 sound/soc/codecs/tlv320aic3x.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index fc68779..157b534 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -1075,7 +1075,7 @@ static int aic3x_regulator_event(struct notifier_block *nb,
 		 * Put codec to reset and require cache sync as at least one
 		 * of the supplies was disabled
 		 */
-		if (aic3x->gpio_reset >= 0)
+		if (gpio_is_valid(aic3x->gpio_reset))
 			gpio_set_value(aic3x->gpio_reset, 0);
 		aic3x->codec->cache_sync = 1;
 	}
@@ -1102,7 +1102,7 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
 		if (!codec->cache_sync)
 			goto out;
 
-		if (aic3x->gpio_reset >= 0) {
+		if (gpio_is_valid(aic3x->gpio_reset)) {
 			udelay(1);
 			gpio_set_value(aic3x->gpio_reset, 1);
 		}
@@ -1359,7 +1359,7 @@ static int aic3x_probe(struct snd_soc_codec *codec)
 		return ret;
 	}
 
-	if (aic3x->gpio_reset >= 0) {
+	if (gpio_is_valid(aic3x->gpio_reset)) {
 		ret = gpio_request(aic3x->gpio_reset, "tlv320aic3x reset");
 		if (ret != 0)
 			goto err_gpio;
@@ -1414,7 +1414,7 @@ err_notif:
 					      &aic3x->disable_nb[i].nb);
 	regulator_bulk_free(ARRAY_SIZE(aic3x->supplies), aic3x->supplies);
 err_get:
-	if (aic3x->gpio_reset >= 0)
+	if (gpio_is_valid(aic3x->gpio_reset))
 		gpio_free(aic3x->gpio_reset);
 err_gpio:
 	kfree(aic3x);
@@ -1427,7 +1427,7 @@ static int aic3x_remove(struct snd_soc_codec *codec)
 	int i;
 
 	aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF);
-	if (aic3x->gpio_reset >= 0) {
+	if (gpio_is_valid(aic3x->gpio_reset)) {
 		gpio_set_value(aic3x->gpio_reset, 0);
 		gpio_free(aic3x->gpio_reset);
 	}
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-03 14:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-01 12:03 [PATCH 1/2] ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_reset Jarkko Nikula
2010-11-01 12:03 ` [PATCH 2/2] ASoC: tlv320aic3x: Add support to shared common reset line Jarkko Nikula
2010-11-01 13:08   ` Mark Brown
2010-11-01 13:07 ` [PATCH 1/2] ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_reset Mark Brown
2010-11-03 14:21   ` Liam Girdwood

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.