aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic3x.c
diff options
context:
space:
mode:
authorJarkko Nikula <jhnikula@gmail.com>2010-11-01 08:03:55 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2010-11-03 10:18:58 -0400
commit79ee820d2aa24ac2577ca4e89ecc49c26d099707 (patch)
treec41ee96fb05e487f230b031614e6826b5e2d299d /sound/soc/codecs/tlv320aic3x.c
parent33ee617f4dad370bee016e4462e69481257453b0 (diff)
ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_reset
I promised to convert this at some point. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/codecs/tlv320aic3x.c')
-rw-r--r--sound/soc/codecs/tlv320aic3x.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index fc687790188b..157b534585f4 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,
1075 * Put codec to reset and require cache sync as at least one 1075 * Put codec to reset and require cache sync as at least one
1076 * of the supplies was disabled 1076 * of the supplies was disabled
1077 */ 1077 */
1078 if (aic3x->gpio_reset >= 0) 1078 if (gpio_is_valid(aic3x->gpio_reset))
1079 gpio_set_value(aic3x->gpio_reset, 0); 1079 gpio_set_value(aic3x->gpio_reset, 0);
1080 aic3x->codec->cache_sync = 1; 1080 aic3x->codec->cache_sync = 1;
1081 } 1081 }
@@ -1102,7 +1102,7 @@ static int aic3x_set_power(struct snd_soc_codec *codec, int power)
1102 if (!codec->cache_sync) 1102 if (!codec->cache_sync)
1103 goto out; 1103 goto out;
1104 1104
1105 if (aic3x->gpio_reset >= 0) { 1105 if (gpio_is_valid(aic3x->gpio_reset)) {
1106 udelay(1); 1106 udelay(1);
1107 gpio_set_value(aic3x->gpio_reset, 1); 1107 gpio_set_value(aic3x->gpio_reset, 1);
1108 } 1108 }
@@ -1359,7 +1359,7 @@ static int aic3x_probe(struct snd_soc_codec *codec)
1359 return ret; 1359 return ret;
1360 } 1360 }
1361 1361
1362 if (aic3x->gpio_reset >= 0) { 1362 if (gpio_is_valid(aic3x->gpio_reset)) {
1363 ret = gpio_request(aic3x->gpio_reset, "tlv320aic3x reset"); 1363 ret = gpio_request(aic3x->gpio_reset, "tlv320aic3x reset");
1364 if (ret != 0) 1364 if (ret != 0)
1365 goto err_gpio; 1365 goto err_gpio;
@@ -1414,7 +1414,7 @@ err_notif:
1414 &aic3x->disable_nb[i].nb); 1414 &aic3x->disable_nb[i].nb);
1415 regulator_bulk_free(ARRAY_SIZE(aic3x->supplies), aic3x->supplies); 1415 regulator_bulk_free(ARRAY_SIZE(aic3x->supplies), aic3x->supplies);
1416err_get: 1416err_get:
1417 if (aic3x->gpio_reset >= 0) 1417 if (gpio_is_valid(aic3x->gpio_reset))
1418 gpio_free(aic3x->gpio_reset); 1418 gpio_free(aic3x->gpio_reset);
1419err_gpio: 1419err_gpio:
1420 kfree(aic3x); 1420 kfree(aic3x);
@@ -1427,7 +1427,7 @@ static int aic3x_remove(struct snd_soc_codec *codec)
1427 int i; 1427 int i;
1428 1428
1429 aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF); 1429 aic3x_set_bias_level(codec, SND_SOC_BIAS_OFF);
1430 if (aic3x->gpio_reset >= 0) { 1430 if (gpio_is_valid(aic3x->gpio_reset)) {
1431 gpio_set_value(aic3x->gpio_reset, 0); 1431 gpio_set_value(aic3x->gpio_reset, 0);
1432 gpio_free(aic3x->gpio_reset); 1432 gpio_free(aic3x->gpio_reset);
1433 } 1433 }