summaryrefslogtreecommitdiffstats
path: root/sound/pci/maestro3.c
diff options
context:
space:
mode:
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 9badbb3bfbd..4c1af425ce7 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);