patch-2.0.5 linux/drivers/sound/sb_common.c

Next file: linux/fs/ext2/namei.c
Previous file: linux/drivers/sound/gus_wave.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.4/linux/drivers/sound/sb_common.c linux/drivers/sound/sb_common.c
@@ -130,14 +130,14 @@
 
   sb_devc        *devc = irq2devc[irq];
 
-  devc->irq_ok = 1;
-
   if (devc == NULL || devc->irq != irq)
     {
       DEB (printk ("sbintr: Bogus interrupt IRQ%d\n", irq));
       return;
     }
 
+  devc->irq_ok = 1;
+
   if (devc->model == MDL_SB16)
     {
 
@@ -671,10 +671,14 @@
   devc->dev = num_audiodevs;
   devc->caps = hw_config->driver_use_1;
 
+  irq2devc[hw_config->irq] = devc;
+  devc->irq_ok = 0;
+
   if (snd_set_irq_handler (hw_config->irq,
 			   sbintr, "sound blaster", devc->osp) < 0)
     {
       printk ("SB: Can't allocate IRQ%d\n", hw_config->irq);
+      irq2devc[hw_config->irq] = NULL;
       return;
     }
 
@@ -697,9 +701,6 @@
 	  }
     }
 
-  irq2devc[hw_config->irq] = devc;
-  devc->irq_ok = 0;
-
   for (n = 0; n < 3 && devc->irq_ok == 0; n++)
     if (sb_dsp_command (devc, 0xf2))	/* Cause interrupt immediately */
       {
@@ -1173,7 +1174,7 @@
 	}
       hw_config->name = "Sound Blaster 16";
       hw_config->irq = -devc->irq;
-      sb16_set_mpu_port(devc, hw_config)
+      sb16_set_mpu_port(devc, hw_config);
       break;
 
     case MDL_ESS:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov