summaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-12-14 12:43:00 +0100
committerMercurial server <hg@alsa0.alsa-project.org>2008-01-31 17:30:25 +0100
commitbd3d1c2096ff99311b8524273ba0f53502365136 (patch)
tree820639b8b86a88976b1de2990f65470340c3b124 /sound/pci
parentc94fa4c9168e51a8dab8e72cb9f0d89673fc8d8c (diff)
[ALSA] emu10k1 - Fix kthread handling at resume
Don't create emu1010 kthread again at resume if it's already created. Also make the thread function static. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/emu10k1/emu10k1_main.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index f29caf1afe06..560bc50e6729 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -707,7 +707,8 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
return 0;
}
-int emu1010_firmware_thread(void *data) {
+static int emu1010_firmware_thread(void *data)
+{
struct snd_emu10k1 * emu = data;
int tmp,tmp2;
int reg;
@@ -1090,10 +1091,12 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */
/* Start Micro/Audio Dock firmware loader thread */
- emu->emu1010.firmware_thread = kthread_create(&emu1010_firmware_thread,
- emu,
- "emu1010_firmware");
- wake_up_process(emu->emu1010.firmware_thread);
+ if (!emu->emu1010.firmware_thread) {
+ emu->emu1010.firmware_thread =
+ kthread_create(emu1010_firmware_thread, emu,
+ "emu1010_firmware");
+ wake_up_process(emu->emu1010.firmware_thread);
+ }
#if 0
snd_emu1010_fpga_link_dst_src_write(emu,
@@ -1257,7 +1260,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
/* Disable 48Volt power to Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 );
}
- if (emu->card_capabilities->emu_model)
+ if (emu->emu1010.firmware_thread)
kthread_stop(emu->emu1010.firmware_thread);
if (emu->memhdr)
snd_util_memhdr_free(emu->memhdr);