mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Manuel Lauss <mano@roarinelk.homelinux.net>,
	Takashi Iwai <tiwai@suse.de>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] ASoC: Only deregister AC97 dev if it's name was not "AC97"
Date: Mon, 16 Mar 2009 23:26:20 +0900 (JST)	[thread overview]
Message-ID: <20090316.232620.95066093.anemo@mba.ocn.ne.jp> (raw)

The commit 14fa43f53ff3a9c3d8b9662574b7369812a31a97 ("ASoC: Only
register AC97 bus if it's not done already") added a condition for
calling of soc_ac97_dev_register() but not added for calling of
soc_ac97_dev_unregister().  This patch adds same condition for
soc_ac97_dev_unregister().  Without this fix, kernel crashes when
unloading an asoc driver.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
I found this problem when I start debugging a new asoc driver.  While
the driver is in very early stage, it should lack many things and have
many bugs.  So I'm not sure this is asoc's bug or my driver's bug.

 sound/soc/soc-core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index ec3f8bb..fec57a3 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1435,7 +1435,8 @@ void snd_soc_free_pcms(struct snd_soc_device *socdev)
 #ifdef CONFIG_SND_SOC_AC97_BUS
 	for (i = 0; i < codec->num_dai; i++) {
 		codec_dai = &codec->dai[i];
-		if (codec_dai->ac97_control && codec->ac97) {
+		if (codec_dai->ac97_control && codec->ac97 &&
+		    strcmp(codec->name, "AC97") != 0) {
 			soc_ac97_dev_unregister(codec);
 			goto free_card;
 		}
-- 
1.5.6.3

             reply	other threads:[~2009-03-16 14:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 14:26 Atsushi Nemoto [this message]
2009-03-16 14:32 ` Takashi Iwai
2009-03-16 15:00   ` Atsushi Nemoto
2009-03-16 16:01   ` Mark Brown
2009-03-17  1:18     ` Atsushi Nemoto
2009-03-17 13:58       ` Mark Brown

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=20090316.232620.95066093.anemo@mba.ocn.ne.jp \
    --to=anemo@mba.ocn.ne.jp \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mano@roarinelk.homelinux.net \
    --cc=tiwai@suse.de \
    /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

all inboxes | Powered by JetHome®