diff options
author | Axel Lin <axel.lin@ingics.com> | 2015-07-25 03:32:16 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-07-29 08:57:15 -0400 |
commit | 82cf77a1bd61d981184a355742a9b5c78f286f97 (patch) | |
tree | 66eb0f1a3ad3c2e366d1be71cd3b40c96191d8f0 /sound/soc/codecs | |
parent | 95f1044f5674b53f67e0933abff228c594792f4c (diff) |
ASoC: tas2552: Remove unneeded NULL test for tas2552->enable_gpio
It's safe to call gpiod_set_value() with NULL desc.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/tas2552.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/soc/codecs/tas2552.c b/sound/soc/codecs/tas2552.c index 4f25a7d0efa2..d6ec004a81b1 100644 --- a/sound/soc/codecs/tas2552.c +++ b/sound/soc/codecs/tas2552.c | |||
@@ -493,8 +493,7 @@ static int tas2552_runtime_suspend(struct device *dev) | |||
493 | regcache_cache_only(tas2552->regmap, true); | 493 | regcache_cache_only(tas2552->regmap, true); |
494 | regcache_mark_dirty(tas2552->regmap); | 494 | regcache_mark_dirty(tas2552->regmap); |
495 | 495 | ||
496 | if (tas2552->enable_gpio) | 496 | gpiod_set_value(tas2552->enable_gpio, 0); |
497 | gpiod_set_value(tas2552->enable_gpio, 0); | ||
498 | 497 | ||
499 | return 0; | 498 | return 0; |
500 | } | 499 | } |
@@ -503,8 +502,7 @@ static int tas2552_runtime_resume(struct device *dev) | |||
503 | { | 502 | { |
504 | struct tas2552_data *tas2552 = dev_get_drvdata(dev); | 503 | struct tas2552_data *tas2552 = dev_get_drvdata(dev); |
505 | 504 | ||
506 | if (tas2552->enable_gpio) | 505 | gpiod_set_value(tas2552->enable_gpio, 1); |
507 | gpiod_set_value(tas2552->enable_gpio, 1); | ||
508 | 506 | ||
509 | tas2552_sw_shutdown(tas2552, 0); | 507 | tas2552_sw_shutdown(tas2552, 0); |
510 | 508 | ||
@@ -585,8 +583,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec) | |||
585 | return ret; | 583 | return ret; |
586 | } | 584 | } |
587 | 585 | ||
588 | if (tas2552->enable_gpio) | 586 | gpiod_set_value(tas2552->enable_gpio, 1); |
589 | gpiod_set_value(tas2552->enable_gpio, 1); | ||
590 | 587 | ||
591 | ret = pm_runtime_get_sync(codec->dev); | 588 | ret = pm_runtime_get_sync(codec->dev); |
592 | if (ret < 0) { | 589 | if (ret < 0) { |
@@ -610,8 +607,7 @@ static int tas2552_codec_probe(struct snd_soc_codec *codec) | |||
610 | return 0; | 607 | return 0; |
611 | 608 | ||
612 | probe_fail: | 609 | probe_fail: |
613 | if (tas2552->enable_gpio) | 610 | gpiod_set_value(tas2552->enable_gpio, 0); |
614 | gpiod_set_value(tas2552->enable_gpio, 0); | ||
615 | 611 | ||
616 | regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies), | 612 | regulator_bulk_disable(ARRAY_SIZE(tas2552->supplies), |
617 | tas2552->supplies); | 613 | tas2552->supplies); |
@@ -624,8 +620,7 @@ static int tas2552_codec_remove(struct snd_soc_codec *codec) | |||
624 | 620 | ||
625 | pm_runtime_put(codec->dev); | 621 | pm_runtime_put(codec->dev); |
626 | 622 | ||
627 | if (tas2552->enable_gpio) | 623 | gpiod_set_value(tas2552->enable_gpio, 0); |
628 | gpiod_set_value(tas2552->enable_gpio, 0); | ||
629 | 624 | ||
630 | return 0; | 625 | return 0; |
631 | }; | 626 | }; |