All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR
@ 2015-07-25  2:23 Axel Lin
  2015-07-29 14:13 ` Applied "ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR" to the asoc tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2015-07-25  2:23 UTC (permalink / raw
  To: Mark Brown; +Cc: Oder Chiou, Bard Liao, alsa-devel, Liam Girdwood

If devm_gpiod_get_optional() return ERR_PTR, it means something wrong
so request gpio fails. We had better return error in such case.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 sound/soc/codecs/rt5677.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 8d70911..83e25a3 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5133,14 +5133,14 @@ static int rt5677_i2c_probe(struct i2c_client *i2c,
 	if (IS_ERR(rt5677->pow_ldo2)) {
 		ret = PTR_ERR(rt5677->pow_ldo2);
 		dev_err(&i2c->dev, "Failed to request POW_LDO2: %d\n", ret);
-		rt5677->pow_ldo2 = 0;
+		return ret;
 	}
 	rt5677->reset_pin = devm_gpiod_get_optional(&i2c->dev,
 			"realtek,reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(rt5677->reset_pin)) {
 		ret = PTR_ERR(rt5677->reset_pin);
 		dev_err(&i2c->dev, "Failed to request RESET: %d\n", ret);
-		rt5677->reset_pin = 0;
+		return ret;
 	}
 
 	if (rt5677->pow_ldo2 || rt5677->reset_pin) {
-- 
2.1.0

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

* Applied "ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR" to the asoc tree
  2015-07-25  2:23 [PATCH v2] ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR Axel Lin
@ 2015-07-29 14:13 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-07-29 14:13 UTC (permalink / raw
  To: Axel Lin, Mark Brown; +Cc: alsa-devel

The patch

   ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR

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 f8163c8673efaabb361281a2759b3167d181ecf6 Mon Sep 17 00:00:00 2001
From: Axel Lin <axel.lin@ingics.com>
Date: Sat, 25 Jul 2015 10:23:40 +0800
Subject: [PATCH] ASoC: rt5677: Return error if devm_gpiod_get_optional return
 ERR_PTR

If devm_gpiod_get_optional() return ERR_PTR, it means something wrong
so request gpio fails. We had better return error in such case.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/rt5677.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/rt5677.c b/sound/soc/codecs/rt5677.c
index 62230e0..3f890a6 100644
--- a/sound/soc/codecs/rt5677.c
+++ b/sound/soc/codecs/rt5677.c
@@ -5133,14 +5133,14 @@ static int rt5677_i2c_probe(struct i2c_client *i2c,
 	if (IS_ERR(rt5677->pow_ldo2)) {
 		ret = PTR_ERR(rt5677->pow_ldo2);
 		dev_err(&i2c->dev, "Failed to request POW_LDO2: %d\n", ret);
-		rt5677->pow_ldo2 = 0;
+		return ret;
 	}
 	rt5677->reset_pin = devm_gpiod_get_optional(&i2c->dev,
 			"realtek,reset", GPIOD_OUT_HIGH);
 	if (IS_ERR(rt5677->reset_pin)) {
 		ret = PTR_ERR(rt5677->reset_pin);
 		dev_err(&i2c->dev, "Failed to request RESET: %d\n", ret);
-		rt5677->reset_pin = 0;
+		return ret;
 	}
 
 	if (rt5677->pow_ldo2 || rt5677->reset_pin) {
-- 
2.1.4

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

end of thread, other threads:[~2015-07-29 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-25  2:23 [PATCH v2] ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR Axel Lin
2015-07-29 14:13 ` Applied "ASoC: rt5677: Return error if devm_gpiod_get_optional return ERR_PTR" to the asoc tree Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.