aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/cs35l33.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2016-06-30 08:13:34 +0800
committerMark Brown <broonie@kernel.org>2016-07-01 11:53:56 +0200
commit410fe39c6d2116aa5584083cbcbb7b3796e09f5d (patch)
treee47902ea8890c5c704e2d7239b94d4a680c69bec /sound/soc/codecs/cs35l33.c
parentASoC: cs35l33: mark PM functions as __maybe_unused (diff)
downloadlinux-dev-410fe39c6d2116aa5584083cbcbb7b3796e09f5d.tar.xz
linux-dev-410fe39c6d2116aa5584083cbcbb7b3796e09f5d.zip
ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional
devm_gpiod_get_optional() returns NULL when the gpio is not assigned. So the if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) test is always false. Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/cs35l33.c')
-rw-r--r--sound/soc/codecs/cs35l33.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c
index d8b5fc3fc45d..689c3598bf3d 100644
--- a/sound/soc/codecs/cs35l33.c
+++ b/sound/soc/codecs/cs35l33.c
@@ -1176,11 +1176,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client,
/* We could issue !RST or skip it based on AMP topology */
cs35l33->reset_gpio = devm_gpiod_get_optional(&i2c_client->dev,
"reset-gpios", GPIOD_OUT_HIGH);
-
- if (PTR_ERR(cs35l33->reset_gpio) == -ENOENT) {
- dev_warn(&i2c_client->dev,
- "%s WARNING: No reset gpio assigned\n", __func__);
- } else if (IS_ERR(cs35l33->reset_gpio)) {
+ if (IS_ERR(cs35l33->reset_gpio)) {
dev_err(&i2c_client->dev, "%s ERROR: Can't get reset GPIO\n",
__func__);
return PTR_ERR(cs35l33->reset_gpio);