2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-24 21:24:00 +08:00

[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>
This commit is contained in:
Takashi Iwai 2007-08-15 22:18:22 +02:00 committed by Jaroslav Kysela
parent 983f8ae406
commit 2525fdc42f

View File

@ -525,6 +525,7 @@ static void snd_hda_codec_free(struct hda_codec *codec)
return;
#ifdef CONFIG_SND_HDA_POWER_SAVE
cancel_delayed_work(&codec->power_work);
flush_scheduled_work();
#endif
list_del(&codec->list);
codec->bus->caddr_tbl[codec->addr] = NULL;
@ -2223,7 +2224,7 @@ void snd_hda_power_up(struct hda_codec *codec)
void snd_hda_power_down(struct hda_codec *codec)
{
--codec->power_count;
if (!codec->power_on)
if (!codec->power_on || codec->power_count)
return;
if (power_save)
schedule_delayed_work(&codec->power_work,