vserver 1.9.5.x5
[linux-2.6.git] / sound / oss / waveartist.c
index 44ab698..99d04ad 100644 (file)
@@ -146,7 +146,7 @@ typedef struct wavnc_port_info {
 
 static int             nr_waveartist_devs;
 static wavnc_info      adev_info[MAX_AUDIO_DEV];
-static spinlock_t      waveartist_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(waveartist_lock);
 
 #ifndef CONFIG_ARCH_NETWINDER
 #define machine_is_netwinder() 0
@@ -1346,18 +1346,20 @@ static int __init probe_waveartist(struct address_info *hw_config)
                return 0;
        }
 
-       if (check_region(hw_config->io_base, 15))  {
+       if (!request_region(hw_config->io_base, 15, hw_config->name))  {
                printk(KERN_WARNING "WaveArtist: I/O port conflict\n");
                return 0;
        }
 
        if (hw_config->irq > 15 || hw_config->irq < 0) {
+               release_region(hw_config->io_base, 15);
                printk(KERN_WARNING "WaveArtist: Bad IRQ %d\n",
                       hw_config->irq);
                return 0;
        }
 
        if (hw_config->dma != 3) {
+               release_region(hw_config->io_base, 15);
                printk(KERN_WARNING "WaveArtist: Bad DMA %d\n",
                       hw_config->dma);
                return 0;
@@ -1392,8 +1394,6 @@ attach_waveartist(struct address_info *hw, const struct waveartist_mixer_info *m
        if (hw->dma != hw->dma2 && hw->dma2 != NO_DMA)
                devc->audio_flags |= DMA_DUPLEX;
 
-       request_region(hw->io_base, 15, devc->hw.name);
-
        devc->mix = mix;
        devc->dev_no = waveartist_init(devc);