Skip to contentSkip to conversation

ASoC: max98090: Fix missing free_irq (part 2)

PATCH In review Jarkko Nikula 2 participants 3 messages Sep 18, 2014 – Sep 19, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: max98090: Fix missing free_irq (part 2)

I was blind to see interrupt was requested in codec probe instead of i2c probe when doing commit 4adeb0ccf86a ("ASoC: max98090: Fix missing free_irq") and there is still a case where interrupt is kept requested. Although not as fatal as original issue.

Since codec can be reprobed while driver is loaded the subsequent max98090_probe() call will fail in interrupt request since it wasn't freed.

Fix this by explicitly freeing irq in max98090_remove().

---
for-next, I don't think this is critical enough for stable.

---
 sound/soc/codecs/max98090.c | 1 +
 1 file changed, 1 insertion(+)
sound/soc/codecs/max98090.c +1 -0
index f1543653a699..ccc1466c0440 100644
@@ -2413,6 +2413,7 @@ static int max98090_remove(struct snd_soc_codec *codec)
 {
 	struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
 
+	devm_free_irq(codec->dev, max98090->irq, codec);
 	cancel_delayed_work_sync(&max98090->jack_work);
 	cancel_delayed_work_sync(&max98090->pll_det_enable_work);
 	cancel_work_sync(&max98090->pll_det_disable_work);
Signature · 1 line
2.1.0
maintainer
#1 lore raw

sound/soc/codecs/max98090.c static int max98090_remove(struct snd_soc_codec *codec) · line 2416

Quoted 9 lines · Jarkko Nikula

---
for-next, I don't think this is critical enough for stable.
---

sound/soc/codecs/max98090.c +1 -0
@@ -2413,6 +2413,7 @@ static int max98090_remove(struct snd_soc_codec *codec)
 {
 	struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
 
+	devm_free_irq(codec->dev, max98090->irq, codec);

If this is a fix for -next shouldn't we be doing the proper fix and moving the resource acquisition to the bus probe?

#2 lore raw
Quoted 9 lines · Mark Brown
Quoted 7 lines · Jarkko Nikula

---
for-next, I don't think this is critical enough for stable.
---

sound/soc/codecs/max98090.c +0 -0
@@ -2413,6 +2413,7 @@ static int max98090_remove(struct snd_soc_codec *codec)
  {
  	struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec);
 
Quoted 3 lines

sound/soc/codecs/max98090.c static int max98090_remove(struct snd_soc_codec *codec) · line 2416

Quoted 1 line
sound/soc/codecs/max98090.c +1 -0
+	devm_free_irq(codec->dev, max98090->irq, codec);

If this is a fix for -next shouldn't we be doing the proper fix and moving the resource acquisition to the bus probe?

Fair enough. I'll cook another version.

Signature · 1 line
Jarkko