[alsa-devel] [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.
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);
Signed-off-by: Axel Lin axel.lin@ingics.com --- sound/soc/codecs/cs35l33.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index aa5c0c5..640fe24 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -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));
On 6/29/16, 7:14 PM, "Axel Lin" axel.lin@ingics.com wrote:
Signed-off-by: Axel Lin axel.lin@ingics.com
sound/soc/codecs/cs35l33.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index aa5c0c5..640fe24 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -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));
Acked-by: Paul Handrigan Paul.Handrigan@cirrus.com
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
From 5d78b027c0d22589d535b3657700e7ff6499d3ed Mon Sep 17 00:00:00 2001
From: Axel Lin axel.lin@ingics.com Date: Thu, 30 Jun 2016 08:14:30 +0800 Subject: [PATCH] ASoC: cs35l33: Fix display revision id
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 --- sound/soc/codecs/cs35l33.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/cs35l33.c b/sound/soc/codecs/cs35l33.c index 689c3598bf3d..a4cbb16d68ad 100644 --- a/sound/soc/codecs/cs35l33.c +++ b/sound/soc/codecs/cs35l33.c @@ -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));
On 6/29/16, 7:13 PM, "Axel Lin" axel.lin@ingics.com wrote:
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)
Acked-by: Paul Handrigan Paul.Handrigan@cirrus.com
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
From 410fe39c6d2116aa5584083cbcbb7b3796e09f5d Mon Sep 17 00:00:00 2001
From: Axel Lin axel.lin@ingics.com 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.
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 --- 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 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);
participants (3)
-
Axel Lin
-
Handrigan, Paul
-
Mark Brown