[alsa-devel] [PATCH] ASoC: tlv320aic32x4: Use gpio_is_valid()

Fabio Estevam festevam at gmail.com
Wed Jan 22 20:24:17 CET 2014


From: Fabio Estevam <fabio.estevam at freescale.com>

We could use gpio_is_valid() for doing the sanity check on the GPIO number.

Signed-off-by: Fabio Estevam <fabio.estevam at freescale.com>
---
 sound/soc/codecs/tlv320aic32x4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 385dec1..02d2d3c 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -687,7 +687,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c,
 		aic32x4->rstn_gpio = -1;
 	}
 
-	if (aic32x4->rstn_gpio >= 0) {
+	if (gpio_is_valid(aic32x4->rstn_gpio)) {
 		ret = devm_gpio_request_one(&i2c->dev, aic32x4->rstn_gpio,
 				GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn");
 		if (ret != 0)
-- 
1.8.1.2



More information about the Alsa-devel mailing list