]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] fix sgalaxy.c driver cli/sti code.
authorJaroslav Kysela <perex@suse.cz>
Sat, 5 Oct 2002 10:28:45 +0000 (03:28 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 5 Oct 2002 10:28:45 +0000 (03:28 -0700)
sound/isa/sgalaxy.c

index 5626a5519b0742017c9df5438c2ce4094290a6f4..7e2378eefeb8a3f796d36e843114f335aade48f0 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/time.h>
+#include <linux/irq.h>
 #include <sound/core.h>
 #include <sound/sb.h>
 #include <sound/ad1848.h>
@@ -110,6 +111,10 @@ static int __init snd_sgalaxy_sbdsp_command(unsigned long port, unsigned char va
        return 0;
 }
 
+static void snd_sgalaxy_dummy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+{
+}
+
 static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma)
 {
        static int interrupt_bits[] = {-1, -1, -1, -1, -1, -1, -1, 0x08, -1, 
@@ -117,8 +122,6 @@ static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma)
        static int dma_bits[] = {1, 2, 0, 3};
        int tmp, tmp1;
 
-       unsigned long flags;
-
        if ((tmp = inb(port + 3)) == 0xff)
        {
                snd_printdd("I/O address dead (0x%lx)\n", port);
@@ -140,20 +143,20 @@ static int __init snd_sgalaxy_setup_wss(unsigned long port, int irq, int dma)
        snd_printdd("sgalaxy - setting up IRQ/DMA for WSS\n");
 #endif
 
-       save_flags(flags);
-       cli();
-
         /* initialize IRQ for WSS codec */
         tmp = interrupt_bits[irq % 16];
-        if (tmp < 0) {
-               restore_flags(flags);
+        if (tmp < 0)
                 return -EINVAL;
-       }
+
+       if (request_irq(irq, snd_sgalaxy_dummy_interrupt, SA_INTERRUPT, "sgalaxy", NULL))
+               return -EIO;
+
         outb(tmp | 0x40, port);
         tmp1 = dma_bits[dma % 4];
         outb(tmp | tmp1, port);
 
-       restore_flags(flags);
+       free_irq(irq, NULL);
+
        return 0;
 }