vserver 1.9.3
[linux-2.6.git] / sound / oss / wf_midi.c
index 379e70f..3ced960 100644 (file)
@@ -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)) {