summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-07-23 17:32:04 +0200
committerMark Brown <broonie@kernel.org>2015-07-23 17:46:00 +0200
commitf285f1610341af4181791938777e0affb5531278 (patch)
tree1130128aa33656870ed63ebeca96b9a012d57424 /sound/soc/codecs
parentASoC: rt5677: Switch to use unified device property API (diff)
downloadlinux-f285f1610341af4181791938777e0affb5531278.tar.xz
linux-f285f1610341af4181791938777e0affb5531278.zip
ASoC: rt5677: Remove NULL test for desc before gpiod_set_value_cansleep call
It's safe to call gpiod_set_value_cansleep() with NULL desc. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r--sound/soc/codecs/rt5677.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 13b871f11023..62230e05eac1 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -4763,10 +4763,8 @@ static int rt5677_remove(struct snd_soc_codec *codec)
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
regmap_write(rt5677->regmap, RT5677_RESET, 0x10ec);
- if (rt5677->pow_ldo2)
- gpiod_set_value_cansleep(rt5677->pow_ldo2, 0);
- if (rt5677->reset_pin)
- gpiod_set_value_cansleep(rt5677->reset_pin, 0);
+ gpiod_set_value_cansleep(rt5677->pow_ldo2, 0);
+ gpiod_set_value_cansleep(rt5677->reset_pin, 0);
return 0;
}
@@ -4780,10 +4778,8 @@ static int rt5677_suspend(struct snd_soc_codec *codec)
regcache_cache_only(rt5677->regmap, true);
regcache_mark_dirty(rt5677->regmap);
- if (rt5677->pow_ldo2)
- gpiod_set_value_cansleep(rt5677->pow_ldo2, 0);
- if (rt5677->reset_pin)
- gpiod_set_value_cansleep(rt5677->reset_pin, 0);
+ gpiod_set_value_cansleep(rt5677->pow_ldo2, 0);
+ gpiod_set_value_cansleep(rt5677->reset_pin, 0);
}
return 0;
@@ -4794,10 +4790,8 @@ static int rt5677_resume(struct snd_soc_codec *codec)
struct rt5677_priv *rt5677 = snd_soc_codec_get_drvdata(codec);
if (!rt5677->dsp_vad_en) {
- if (rt5677->pow_ldo2)
- gpiod_set_value_cansleep(rt5677->pow_ldo2, 1);
- if (rt5677->reset_pin)
- gpiod_set_value_cansleep(rt5677->reset_pin, 1);
+ gpiod_set_value_cansleep(rt5677->pow_ldo2, 1);
+ gpiod_set_value_cansleep(rt5677->reset_pin, 1);
if (rt5677->pow_ldo2 || rt5677->reset_pin)
msleep(10);