aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-26 08:13:44 -0400
committerJaroslav Kysela <perex@suse.cz>2007-05-11 10:56:11 -0400
commitb7dd2b349a9fa9e4347780c2bbb41e51484b5bb5 (patch)
treef5b896fd062a410e46bc35963fe15cdaed38f654 /sound/pci/maestro3.c
parentf223a9fc3d5707c354588570e2cf1f3abf6b1f84 (diff)
[ALSA] Don't use request_firmware if internal firmwares are defined
Don't use request_firmware() if the internal firmwares are defined via Kconfig. Otherwise it results in a significant delay at loading time (minutes). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/pci/maestro3.c')
-rw-r--r--sound/pci/maestro3.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 9badbb3bfbd1..4c1af425ce75 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -2240,7 +2240,7 @@ static const struct firmware assp_minisrc = {
2240 .size = sizeof assp_minisrc_image 2240 .size = sizeof assp_minisrc_image
2241}; 2241};
2242 2242
2243#endif /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */ 2243#else /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
2244 2244
2245#ifdef __LITTLE_ENDIAN 2245#ifdef __LITTLE_ENDIAN
2246static inline void snd_m3_convert_from_le(const struct firmware *fw) { } 2246static inline void snd_m3_convert_from_le(const struct firmware *fw) { }
@@ -2255,6 +2255,8 @@ static void snd_m3_convert_from_le(const struct firmware *fw)
2255} 2255}
2256#endif 2256#endif
2257 2257
2258#endif /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
2259
2258 2260
2259/* 2261/*
2260 * initialize ASSP 2262 * initialize ASSP
@@ -2548,14 +2550,10 @@ static int snd_m3_free(struct snd_m3 *chip)
2548 if (chip->iobase) 2550 if (chip->iobase)
2549 pci_release_regions(chip->pci); 2551 pci_release_regions(chip->pci);
2550 2552
2551#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL 2553#ifndef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
2552 if (chip->assp_kernel_image != &assp_kernel) 2554 release_firmware(chip->assp_kernel_image);
2555 release_firmware(chip->assp_minisrc_image);
2553#endif 2556#endif
2554 release_firmware(chip->assp_kernel_image);
2555#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
2556 if (chip->assp_minisrc_image != &assp_minisrc)
2557#endif
2558 release_firmware(chip->assp_minisrc_image);
2559 2557
2560 pci_disable_device(chip->pci); 2558 pci_disable_device(chip->pci);
2561 kfree(chip); 2559 kfree(chip);
@@ -2745,29 +2743,29 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
2745 return -ENOMEM; 2743 return -ENOMEM;
2746 } 2744 }
2747 2745
2746#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
2747 chip->assp_kernel_image = &assp_kernel;
2748#else
2748 err = request_firmware(&chip->assp_kernel_image, 2749 err = request_firmware(&chip->assp_kernel_image,
2749 "ess/maestro3_assp_kernel.fw", &pci->dev); 2750 "ess/maestro3_assp_kernel.fw", &pci->dev);
2750 if (err < 0) { 2751 if (err < 0) {
2751#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
2752 chip->assp_kernel_image = &assp_kernel;
2753#else
2754 snd_m3_free(chip); 2752 snd_m3_free(chip);
2755 return err; 2753 return err;
2756#endif
2757 } else 2754 } else
2758 snd_m3_convert_from_le(chip->assp_kernel_image); 2755 snd_m3_convert_from_le(chip->assp_kernel_image);
2756#endif
2759 2757
2758#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
2759 chip->assp_minisrc_image = &assp_minisrc;
2760#else
2760 err = request_firmware(&chip->assp_minisrc_image, 2761 err = request_firmware(&chip->assp_minisrc_image,
2761 "ess/maestro3_assp_minisrc.fw", &pci->dev); 2762 "ess/maestro3_assp_minisrc.fw", &pci->dev);
2762 if (err < 0) { 2763 if (err < 0) {
2763#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
2764 chip->assp_minisrc_image = &assp_minisrc;
2765#else
2766 snd_m3_free(chip); 2764 snd_m3_free(chip);
2767 return err; 2765 return err;
2768#endif
2769 } else 2766 } else
2770 snd_m3_convert_from_le(chip->assp_minisrc_image); 2767 snd_m3_convert_from_le(chip->assp_minisrc_image);
2768#endif
2771 2769
2772 if ((err = pci_request_regions(pci, card->driver)) < 0) { 2770 if ((err = pci_request_regions(pci, card->driver)) < 0) {
2773 snd_m3_free(chip); 2771 snd_m3_free(chip);