Skip to contentSkip to conversation

ASoC: tlv320aic32x4: Use gpio_is_valid()

PATCH In review Fabio Estevam 2 participants 2 messages Jan 22, 2014 – Jan 23, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: tlv320aic32x4: Use gpio_is_valid()

From: Fabio Estevam <[email protected]>

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

---
 sound/soc/codecs/tlv320aic32x4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/tlv320aic32x4.c +1 -1
index 385dec1..02d2d3c 100644
@@ -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)
Signature · 1 line
1.8.1.2
#1 lore raw

Hi Fabio,

Quoted 5 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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

This looks like the same patch as [1].

[1] http://thread.gmane.org/gmane.linux.alsa.devel/117668/focus=117669

Regards,

Markus

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |