Skip to contentSkip to conversation

ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional

PATCH In review Axel Lin 3 participants 6 messages Jun 30, 2016 – Jul 1, 2016

Subsystems (3)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 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.

---
 sound/soc/codecs/cs35l33.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
sound/soc/codecs/cs35l33.c +1 -5
index 622a111..aa5c0c5 100644
@@ -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);
Signature · 1 line
2.5.0
author
#1 lore raw

PATCH 2/2 ASoC: cs35l33: Fix display revision id

---
 sound/soc/codecs/cs35l33.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs35l33.c +1 -1
index aa5c0c5..640fe24 100644
@@ -1219,7 +1219,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client,
 	}
 
 	dev_info(&i2c_client->dev,
-		 "Cirrus Logic CS35L33, Revision: %02X\n", ret & 0xFF);
+		 "Cirrus Logic CS35L33, Revision: %02X\n", reg & 0xFF);
 
 	ret = regmap_register_patch(cs35l33->regmap,
 			cs35l33_patch, ARRAY_SIZE(cs35l33_patch));
Signature · 1 line
2.5.0
Acked-by on v1 1/2
#4 lore raw
In reply to Axel Lin
Quoted 25 lines · Axel Lin

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.

---
sound/soc/codecs/cs35l33.c | 6 +-----

1 file changed, 1 insertion(+), 5 deletions(-)
sound/soc/codecs/cs35l33.c +1 -5
index 622a111..aa5c0c5 100644
@@ -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__);
Quoted 1 line
		return PTR_ERR(cs35l33->reset_gpio)
Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] ASoC: cs35l33: Fix display revision id

In reply to Axel Lin
Quoted 18 lines · Axel Lin

---
sound/soc/codecs/cs35l33.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs35l33.c +1 -1
index aa5c0c5..640fe24 100644
@@ -1219,7 +1219,7 @@ static int cs35l33_i2c_probe(struct i2c_client
 *i2c_client,
 	}
 
 	dev_info(&i2c_client->dev,
-		 "Cirrus Logic CS35L33, Revision: %02X\n", ret & 0xFF);
+		 "Cirrus Logic CS35L33, Revision: %02X\n", reg & 0xFF);
 
 	ret = regmap_register_patch(cs35l33->regmap,
Quoted 1 line
			cs35l33_patch, ARRAY_SIZE(cs35l33_patch));
maintainer
#3 lore raw

Applied "ASoC: cs35l33: Fix display revision id" to the asoc tree

In reply to Axel Lin

The patch

ASoC: cs35l33: Fix display revision id

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 5d78b027c0d22589d535b3657700e7ff6499d3ed Mon Sep 17 00:00:00 2001

From: Axel Lin <[email protected]>
Date: Thu, 30 Jun 2016 08:14:30 +0800
Subject: [PATCH] ASoC: cs35l33: Fix display revision id

---
 sound/soc/codecs/cs35l33.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/cs35l33.c +1 -1
index 689c3598bf3d..a4cbb16d68ad 100644
@@ -1219,7 +1219,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client,
 	}
 
 	dev_info(&i2c_client->dev,
-		 "Cirrus Logic CS35L33, Revision: %02X\n", ret & 0xFF);
+		 "Cirrus Logic CS35L33, Revision: %02X\n", reg & 0xFF);
 
 	ret = regmap_register_patch(cs35l33->regmap,
 			cs35l33_patch, ARRAY_SIZE(cs35l33_patch));
Signature · 1 line
2.8.1
maintainer
#5 lore raw

Applied "ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional" to the asoc tree

In reply to Axel Lin

The patch

ASoC: cs35l33: Fix testing return value of devm_gpiod_get_optional

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 410fe39c6d2116aa5584083cbcbb7b3796e09f5d Mon Sep 17 00:00:00 2001

From: Axel Lin <[email protected]>
Date: Thu, 30 Jun 2016 08:13:34 +0800
Subject: [PATCH] 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.

---
 sound/soc/codecs/cs35l33.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
sound/soc/codecs/cs35l33.c +1 -5
index d8b5fc3fc45d..689c3598bf3d 100644
@@ -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);
Signature · 1 line
2.8.1