Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Mack <zonque@gmail.com>
To: broonie@kernel.org, subaparts@yandex.ru
Cc: brian.austin@cirrus.com, alsa-devel@alsa-project.org,
	Paul.Handrigan@cirrus.com, Daniel Mack <zonque@gmail.com>
Subject: [PATCH] ASoC: cs4271: free reset gpio in cs4271_remove()
Date: Wed, 19 Feb 2014 12:07:12 +0100	[thread overview]
Message-ID: <1392808032-25756-1-git-send-email-zonque@gmail.com> (raw)

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

             reply	other threads:[~2014-02-19 11:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 11:07 Daniel Mack [this message]
2014-02-19 11:15 ` [PATCH] ASoC: cs4271: free reset gpio in cs4271_remove() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1392808032-25756-1-git-send-email-zonque@gmail.com \
    --to=zonque@gmail.com \
    --cc=Paul.Handrigan@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=brian.austin@cirrus.com \
    --cc=broonie@kernel.org \
    --cc=subaparts@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox