X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fwf_midi.c;h=3f3a390014caf29165fa0d45b06b7739fe5bd1e5;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=379e70f2c9f8546d3aa30d4da0158289680ec8db;hpb=9213980e6a70d8473e0ffd4b39ab5b6caaba9ff5;p=linux-2.6.git diff --git a/sound/oss/wf_midi.c b/sound/oss/wf_midi.c index 379e70f2c..3f3a39001 100644 --- a/sound/oss/wf_midi.c +++ b/sound/oss/wf_midi.c @@ -81,7 +81,7 @@ static struct wf_mpu_config *phys_dev = &devs[0]; static struct wf_mpu_config *virt_dev = &devs[1]; static void start_uart_mode (void); -static spinlock_t lock=SPIN_LOCK_UNLOCKED; +static DEFINE_SPINLOCK(lock); #define OUTPUT_READY 0x40 #define INPUT_AVAIL 0x80 @@ -784,7 +784,7 @@ virtual_midi_disable (void) int __init detect_wf_mpu (int irq, int io_base) { - if (check_region (io_base, 2)) { + if (!request_region(io_base, 2, "wavefront midi")) { printk (KERN_WARNING "WF-MPU: I/O port %x already in use.\n", io_base); return -1; @@ -803,11 +803,10 @@ int __init install_wf_mpu (void) if ((phys_dev->devno = sound_alloc_mididev()) < 0){ printk (KERN_ERR "WF-MPU: Too many MIDI devices detected.\n"); + release_region(phys_dev->base, 2); return -1; - } - request_region (phys_dev->base, 2, "wavefront midi"); phys_dev->isvirtual = 0; if (config_wf_mpu (phys_dev)) { @@ -821,7 +820,7 @@ int __init install_wf_mpu (void) /* OK, now we're configured to handle an interrupt ... */ - if (request_irq (phys_dev->irq, wf_mpuintr, SA_INTERRUPT|SA_SHIRQ, + if (request_irq (phys_dev->irq, wf_mpuintr, IRQF_DISABLED|IRQF_SHARED, "wavefront midi", phys_dev) < 0) { printk (KERN_ERR "WF-MPU: Failed to allocate IRQ%d\n",