diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-08-15 16:18:22 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:58:59 -0400 |
commit | 2525fdc42fdc4bb943ec2fa5a37e2ae139e1b6d3 (patch) | |
tree | 92373fea15d39b10b683dd28298c9e8c0cd19f31 | |
parent | 983f8ae4067cf0731f19fc6bda3bc3ef200c32e7 (diff) |
[ALSA] hda-intel - Add flush_scheduled_work() in snd_hda_codec_free()
Added flush_scheduled_work() in snd_hda_codec_free() to make sure that
the all work is gone. Also, optimized the condition to schedule the
delayed work in snd_hda_power_down().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 0e923f3f0a80..0b9029436bb4 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -525,6 +525,7 @@ static void snd_hda_codec_free(struct hda_codec *codec) | |||
525 | return; | 525 | return; |
526 | #ifdef CONFIG_SND_HDA_POWER_SAVE | 526 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
527 | cancel_delayed_work(&codec->power_work); | 527 | cancel_delayed_work(&codec->power_work); |
528 | flush_scheduled_work(); | ||
528 | #endif | 529 | #endif |
529 | list_del(&codec->list); | 530 | list_del(&codec->list); |
530 | codec->bus->caddr_tbl[codec->addr] = NULL; | 531 | codec->bus->caddr_tbl[codec->addr] = NULL; |
@@ -2223,7 +2224,7 @@ void snd_hda_power_up(struct hda_codec *codec) | |||
2223 | void snd_hda_power_down(struct hda_codec *codec) | 2224 | void snd_hda_power_down(struct hda_codec *codec) |
2224 | { | 2225 | { |
2225 | --codec->power_count; | 2226 | --codec->power_count; |
2226 | if (!codec->power_on) | 2227 | if (!codec->power_on || codec->power_count) |
2227 | return; | 2228 | return; |
2228 | if (power_save) | 2229 | if (power_save) |
2229 | schedule_delayed_work(&codec->power_work, | 2230 | schedule_delayed_work(&codec->power_work, |