All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs35l35: Clear reset_gpio on the error path in probe
@ 2017-03-27 15:54 Charles Keepax
  2017-03-27 16:04 ` Brian Austin
  2017-03-29 11:02 ` Applied "ASoC: cs35l35: Clear reset_gpio on the error path in probe" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Charles Keepax @ 2017-03-27 15:54 UTC (permalink / raw)
  To: broonie; +Cc: brian.austin, alsa-devel, lgirdwood, Paul.Handrigan, patches

The error path in probe attempts to put the device back into reset.
Should we fail to get the reset_gpio (such as a probe defer) we will
leave the error value in there, which the gpiod_set_value_cansleep on
the error path will attempt to deference.

Fix this issue by clearing reset_gpio before we head into the error
path.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/cs35l35.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index 1d9f332..9688274 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -1412,10 +1412,10 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client,
 						      GPIOD_OUT_LOW);
 	if (IS_ERR(cs35l35->reset_gpio)) {
 		ret = PTR_ERR(cs35l35->reset_gpio);
+		cs35l35->reset_gpio = NULL;
 		if (ret == -EBUSY) {
 			dev_info(dev,
 				 "Reset line busy, assuming shared reset\n");
-			cs35l35->reset_gpio = NULL;
 		} else {
 			dev_err(dev, "Failed to get reset GPIO: %d\n", ret);
 			goto err;
-- 
2.1.4

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

* Re: [PATCH] ASoC: cs35l35: Clear reset_gpio on the error path in probe
  2017-03-27 15:54 [PATCH] ASoC: cs35l35: Clear reset_gpio on the error path in probe Charles Keepax
@ 2017-03-27 16:04 ` Brian Austin
  2017-03-29 11:02 ` Applied "ASoC: cs35l35: Clear reset_gpio on the error path in probe" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Austin @ 2017-03-27 16:04 UTC (permalink / raw)
  To: Charles Keepax
  Cc: alsa-devel, patches, brian.austin, Paul.Handrigan, lgirdwood, broonie

On Mon, 27 Mar 2017, Charles Keepax wrote:

> The error path in probe attempts to put the device back into reset.
> Should we fail to get the reset_gpio (such as a probe defer) we will
> leave the error value in there, which the gpiod_set_value_cansleep on
> the error path will attempt to deference.
> 
> Fix this issue by clearing reset_gpio before we head into the error
> path.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
> ---
Acked-by: Brian Austin <brian.austin@cirrus.com>

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

* Applied "ASoC: cs35l35: Clear reset_gpio on the error path in probe" to the asoc tree
  2017-03-27 15:54 [PATCH] ASoC: cs35l35: Clear reset_gpio on the error path in probe Charles Keepax
  2017-03-27 16:04 ` Brian Austin
@ 2017-03-29 11:02 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2017-03-29 11:02 UTC (permalink / raw)
  To: Charles Keepax
  Cc: brian.austin, patches, alsa-devel, Paul.Handrigan, lgirdwood, broonie

The patch

   ASoC: cs35l35: Clear reset_gpio on the error path in probe

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 8e71321d19c4ed02d9eed15955b8d485bab016fc Mon Sep 17 00:00:00 2001
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Date: Mon, 27 Mar 2017 16:54:27 +0100
Subject: [PATCH] ASoC: cs35l35: Clear reset_gpio on the error path in probe

The error path in probe attempts to put the device back into reset.
Should we fail to get the reset_gpio (such as a probe defer) we will
leave the error value in there, which the gpiod_set_value_cansleep on
the error path will attempt to deference.

Fix this issue by clearing reset_gpio before we head into the error
path.

Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/cs35l35.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l35.c b/sound/soc/codecs/cs35l35.c
index 1d9f332b2eec..9688274f7c90 100644
--- a/sound/soc/codecs/cs35l35.c
+++ b/sound/soc/codecs/cs35l35.c
@@ -1412,10 +1412,10 @@ static int cs35l35_i2c_probe(struct i2c_client *i2c_client,
 						      GPIOD_OUT_LOW);
 	if (IS_ERR(cs35l35->reset_gpio)) {
 		ret = PTR_ERR(cs35l35->reset_gpio);
+		cs35l35->reset_gpio = NULL;
 		if (ret == -EBUSY) {
 			dev_info(dev,
 				 "Reset line busy, assuming shared reset\n");
-			cs35l35->reset_gpio = NULL;
 		} else {
 			dev_err(dev, "Failed to get reset GPIO: %d\n", ret);
 			goto err;
-- 
2.11.0

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

end of thread, other threads:[~2017-03-29 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 15:54 [PATCH] ASoC: cs35l35: Clear reset_gpio on the error path in probe Charles Keepax
2017-03-27 16:04 ` Brian Austin
2017-03-29 11:02 ` Applied "ASoC: cs35l35: Clear reset_gpio on the error path in probe" 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.