diff mbox

[1/4] ASoC: twl6040: Drop using devm_request_threaded_irq()

Message ID 1372081326-6917-2-git-send-email-peter.ujfalusi@ti.com
State Accepted
Commit f60596d61fc238befd169ea394ba6a458fafd774
Headers show

Commit Message

Peter Ujfalusi June 24, 2013, 1:42 p.m. UTC
We need to free the irq at twl6040_remove() which is called when the machine
driver has been removed (the card has been removed).
If we fail to do that, next time when the machine driver is loaded the
codec's probe will fail since the irq has been already requested.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 sound/soc/codecs/twl6040.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Mark Brown June 24, 2013, 3:06 p.m. UTC | #1
On Mon, Jun 24, 2013 at 03:42:03PM +0200, Peter Ujfalusi wrote:
> We need to free the irq at twl6040_remove() which is called when the machine
> driver has been removed (the card has been removed).
> If we fail to do that, next time when the machine driver is loaded the
> codec's probe will fail since the irq has been already requested.

Applied all, thanks.
diff mbox

Patch

diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c
index 9b9a6e5..c2f2fdb 100644
--- a/sound/soc/codecs/twl6040.c
+++ b/sound/soc/codecs/twl6040.c
@@ -1143,7 +1143,7 @@  static int twl6040_probe(struct snd_soc_codec *codec)
 
 	mutex_init(&priv->mutex);
 
-	ret = devm_request_threaded_irq(codec->dev, priv->plug_irq, NULL,
+	ret = request_threaded_irq(priv->plug_irq, NULL,
 					twl6040_audio_handler, IRQF_NO_SUSPEND,
 					"twl6040_irq_plug", codec);
 	if (ret) {
@@ -1159,6 +1159,9 @@  static int twl6040_probe(struct snd_soc_codec *codec)
 
 static int twl6040_remove(struct snd_soc_codec *codec)
 {
+	struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec);
+
+	free_irq(priv->plug_irq, codec);
 	twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF);
 
 	return 0;