[ALSA] Fix invalid schedule_timeout_interruptible()
[linux-2.6.git] / sound / isa / wavefront / wavefront_fx.c
index 15331ed8819449b03864dcdebd062048f4f4954f..fc95a870f69017aa17cf20f175633abb0d1af8d1 100644 (file)
@@ -35,9 +35,7 @@
 
 #define WAIT_IDLE      0xff
 
-#define FIRMWARE_IN_THE_KERNEL
-
-#ifdef FIRMWARE_IN_THE_KERNEL
+#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
 #include "yss225.c"
 static const struct firmware yss225_registers_firmware = {
        .data = (u8 *)yss225_registers,
@@ -258,21 +256,21 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
 {
        unsigned int i;
        int err;
-       const struct firmware *firmware;
+       const struct firmware *firmware = NULL;
 
        if (dev->fx_initialized)
                return 0;
 
+#ifdef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
+       firmware = &yss225_registers_firmware;
+#else
        err = request_firmware(&firmware, "yamaha/yss225_registers.bin",
                               dev->card->dev);
        if (err < 0) {
-#ifdef FIRMWARE_IN_THE_KERNEL
-               firmware = &yss225_registers_firmware;
-#else
                err = -1;
                goto out;
-#endif
        }
+#endif
 
        for (i = 0; i + 1 < firmware->size; i += 2) {
                if (firmware->data[i] >= 8 && firmware->data[i] < 16) {
@@ -295,9 +293,12 @@ snd_wavefront_fx_start (snd_wavefront_t *dev)
        err = 0;
 
 out:
-#ifdef FIRMWARE_IN_THE_KERNEL
-       if (firmware != &yss225_registers_firmware)
+#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
+       release_firmware(firmware);
 #endif
-               release_firmware(firmware);
        return err;
 }
+
+#ifndef CONFIG_SND_WAVEFRONT_FIRMWARE_IN_KERNEL
+MODULE_FIRMWARE("yamaha/yss225_registers.bin");
+#endif