summaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2007-04-26 14:13:44 +0200
committerJaroslav Kysela <perex@suse.cz>2007-05-11 16:56:11 +0200
commitb7dd2b349a9fa9e4347780c2bbb41e51484b5bb5 (patch)
treef5b896fd062a410e46bc35963fe15cdaed38f654 /sound/pci/maestro3.c
parentf223a9fc3d5707c354588570e2cf1f3abf6b1f84 (diff)
downloadlinux-b7dd2b349a9fa9e4347780c2bbb41e51484b5bb5.tar.bz2
[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 = {
.size = sizeof assp_minisrc_image
};
-#endif /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
+#else /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
#ifdef __LITTLE_ENDIAN
static 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)
}
#endif
+#endif /* CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL */
+
/*
* initialize ASSP
@@ -2548,14 +2550,10 @@ static int snd_m3_free(struct snd_m3 *chip)
if (chip->iobase)
pci_release_regions(chip->pci);
-#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
- if (chip->assp_kernel_image != &assp_kernel)
+#ifndef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+ release_firmware(chip->assp_kernel_image);
+ release_firmware(chip->assp_minisrc_image);
#endif
- release_firmware(chip->assp_kernel_image);
-#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
- if (chip->assp_minisrc_image != &assp_minisrc)
-#endif
- release_firmware(chip->assp_minisrc_image);
pci_disable_device(chip->pci);
kfree(chip);
@@ -2745,29 +2743,29 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
return -ENOMEM;
}
+#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+ chip->assp_kernel_image = &assp_kernel;
+#else
err = request_firmware(&chip->assp_kernel_image,
"ess/maestro3_assp_kernel.fw", &pci->dev);
if (err < 0) {
-#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
- chip->assp_kernel_image = &assp_kernel;
-#else
snd_m3_free(chip);
return err;
-#endif
} else
snd_m3_convert_from_le(chip->assp_kernel_image);
+#endif
+#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
+ chip->assp_minisrc_image = &assp_minisrc;
+#else
err = request_firmware(&chip->assp_minisrc_image,
"ess/maestro3_assp_minisrc.fw", &pci->dev);
if (err < 0) {
-#ifdef CONFIG_SND_MAESTRO3_FIRMWARE_IN_KERNEL
- chip->assp_minisrc_image = &assp_minisrc;
-#else
snd_m3_free(chip);
return err;
-#endif
} else
snd_m3_convert_from_le(chip->assp_minisrc_image);
+#endif
if ((err = pci_request_regions(pci, card->driver)) < 0) {
snd_m3_free(chip);