alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional
@ 2016-06-30  0:13 Axel Lin
  2016-06-30  0:14 ` [PATCH 2/2] ASoC: cs35l33: Fix display revision id Axel Lin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Axel Lin @ 2016-06-30  0:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Brian Austin, alsa-devel, Liam Girdwood, Paul Handrigan

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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-07-01  9:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-30  0:13 [PATCH 1/2] ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional Axel Lin
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

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).