diff options
author | Takashi Iwai <tiwai@suse.de> | 2007-12-14 06:43:00 -0500 |
---|---|---|
committer | Mercurial server <hg@alsa0.alsa-project.org> | 2008-01-31 11:30:25 -0500 |
commit | bd3d1c2096ff99311b8524273ba0f53502365136 (patch) | |
tree | 820639b8b86a88976b1de2990f65470340c3b124 /sound/pci | |
parent | c94fa4c9168e51a8dab8e72cb9f0d89673fc8d8c (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.c | 15 |
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 | |||
707 | return 0; | 707 | return 0; |
708 | } | 708 | } |
709 | 709 | ||
710 | int emu1010_firmware_thread(void *data) { | 710 | static int emu1010_firmware_thread(void *data) |
711 | { | ||
711 | struct snd_emu10k1 * emu = data; | 712 | struct snd_emu10k1 * emu = data; |
712 | int tmp,tmp2; | 713 | int tmp,tmp2; |
713 | int reg; | 714 | int reg; |
@@ -1090,10 +1091,12 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu) | |||
1090 | snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */ | 1091 | snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */ |
1091 | 1092 | ||
1092 | /* Start Micro/Audio Dock firmware loader thread */ | 1093 | /* Start Micro/Audio Dock firmware loader thread */ |
1093 | emu->emu1010.firmware_thread = kthread_create(&emu1010_firmware_thread, | 1094 | if (!emu->emu1010.firmware_thread) { |
1094 | emu, | 1095 | emu->emu1010.firmware_thread = |
1095 | "emu1010_firmware"); | 1096 | kthread_create(emu1010_firmware_thread, emu, |
1096 | wake_up_process(emu->emu1010.firmware_thread); | 1097 | "emu1010_firmware"); |
1098 | wake_up_process(emu->emu1010.firmware_thread); | ||
1099 | } | ||
1097 | 1100 | ||
1098 | #if 0 | 1101 | #if 0 |
1099 | snd_emu1010_fpga_link_dst_src_write(emu, | 1102 | snd_emu1010_fpga_link_dst_src_write(emu, |
@@ -1257,7 +1260,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu) | |||
1257 | /* Disable 48Volt power to Audio Dock */ | 1260 | /* Disable 48Volt power to Audio Dock */ |
1258 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 ); | 1261 | snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 ); |
1259 | } | 1262 | } |
1260 | if (emu->card_capabilities->emu_model) | 1263 | if (emu->emu1010.firmware_thread) |
1261 | kthread_stop(emu->emu1010.firmware_thread); | 1264 | kthread_stop(emu->emu1010.firmware_thread); |
1262 | if (emu->memhdr) | 1265 | if (emu->memhdr) |
1263 | snd_util_memhdr_free(emu->memhdr); | 1266 | snd_util_memhdr_free(emu->memhdr); |