Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs4271: free reset gpio in cs4271_remove()
@ 2014-02-19 11:07 Daniel Mack
  2014-02-19 11:15 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Mack @ 2014-02-19 11:07 UTC (permalink / raw)
  To: broonie, subaparts; +Cc: brian.austin, alsa-devel, Paul.Handrigan, Daniel Mack

The reset GPIO line is acquired in cs4271_probe(), so it should be
freed from cs4271_remove() as well. This way, the driver can unloaded
and reloaded more than once.

Signed-off-by: Daniel Mack <zonque@gmail.com>
---
 sound/soc/codecs/cs4271.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c
index ce05fd9..aeaa5c6 100644
--- a/sound/soc/codecs/cs4271.c
+++ b/sound/soc/codecs/cs4271.c
@@ -604,9 +604,11 @@ static int cs4271_remove(struct snd_soc_codec *codec)
 {
 	struct cs4271_private *cs4271 = snd_soc_codec_get_drvdata(codec);
 
-	if (gpio_is_valid(cs4271->gpio_nreset))
+	if (gpio_is_valid(cs4271->gpio_nreset)) {
 		/* Set codec to the reset state */
 		gpio_set_value(cs4271->gpio_nreset, 0);
+		devm_gpio_free(codec->dev, cs4271->gpio_nreset);
+	}
 
 	return 0;
 };
-- 
1.8.5.3

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

end of thread, other threads:[~2014-02-19 14:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-19 11:07 [PATCH] ASoC: cs4271: free reset gpio in cs4271_remove() Daniel Mack
2014-02-19 11:15 ` Mark Brown
2014-02-19 11:24   ` Daniel Mack
2014-02-19 11:43     ` Mark Brown
2014-02-19 12:09       ` Daniel Mack
2014-02-19 14:00         ` Mark Brown
2014-02-19 11:43     ` Lars-Peter Clausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox