Commit a74ab512 authored by Markus Pargmann's avatar Markus Pargmann Committed by Mark Brown

ASoC: tlv320aic32x4: Use gpio_is_valid

Use function gpio_is_valid to check for gpio ports.
Signed-off-by: default avatarMarkus Pargmann <mpa@pengutronix.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 38dbfb59
...@@ -588,7 +588,7 @@ static int aic32x4_probe(struct snd_soc_codec *codec) ...@@ -588,7 +588,7 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP); snd_soc_codec_set_cache_io(codec, 8, 8, SND_SOC_REGMAP);
if (aic32x4->rstn_gpio >= 0) { if (gpio_is_valid(aic32x4->rstn_gpio)) {
ndelay(10); ndelay(10);
gpio_set_value(aic32x4->rstn_gpio, 1); gpio_set_value(aic32x4->rstn_gpio, 1);
} }
...@@ -693,7 +693,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c, ...@@ -693,7 +693,7 @@ static int aic32x4_i2c_probe(struct i2c_client *i2c,
aic32x4->rstn_gpio = -1; 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, ret = devm_gpio_request_one(&i2c->dev, aic32x4->rstn_gpio,
GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn"); GPIOF_OUT_INIT_LOW, "tlv320aic32x4 rstn");
if (ret != 0) if (ret != 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment