From: Axel Lin <axel.lin@ingics.com>
To: Mark Brown <broonie@kernel.org>
Cc: Brian Austin <brian.austin@cirrus.com>,
alsa-devel@alsa-project.org, Liam Girdwood <lgirdwood@gmail.com>,
Paul Handrigan <Paul.Handrigan@cirrus.com>
Subject: [PATCH 1/2] ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional
Date: Thu, 30 Jun 2016 08:13:34 +0800 [thread overview]
Message-ID: <1467245614.7105.2.camel@ingics.com> (raw)
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>
---
sound/soc/codecs/cs35l33.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c
index 622a111..aa5c0c5 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);
--
2.5.0
next reply other threads:[~2016-06-30 0:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-30 0:13 Axel Lin [this message]
2016-06-30 0:14 ` [PATCH 2/2] ASoC: cs35l33: Fix display revision id Axel Lin
2016-06-30 15:36 ` Handrigan, Paul
2016-07-01 9:54 ` Applied "ASoC: cs35l33: Fix display revision id" to the asoc tree Mark Brown
2016-06-30 15:36 ` [PATCH 1/2] ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional Handrigan, Paul
2016-07-01 9:54 ` Applied "ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional" to the asoc tree Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467245614.7105.2.camel@ingics.com \
--to=axel.lin@ingics.com \
--cc=Paul.Handrigan@cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=brian.austin@cirrus.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).