linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / sound / pci / atiixp.c
index d0f759d..b7217ad 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
-#include <linux/mutex.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -278,13 +277,13 @@ struct atiixp {
        unsigned int codec_not_ready_bits;      /* for codec detection */
 
        int spdif_over_aclink;          /* passed from the module option */
-       struct mutex open_mutex;        /* playback open mutex */
+       struct semaphore open_mutex;    /* playback open mutex */
 };
 
 
 /*
  */
-static struct pci_device_id snd_atiixp_ids[] __devinitdata = {
+static struct pci_device_id snd_atiixp_ids[] = {
        { 0x1002, 0x4341, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB200 */
        { 0x1002, 0x4361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB300 */
        { 0x1002, 0x4370, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* SB400 */
@@ -1052,9 +1051,9 @@ static int snd_atiixp_playback_open(struct snd_pcm_substream *substream)
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
 
-       mutex_lock(&chip->open_mutex);
+       down(&chip->open_mutex);
        err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 0);
-       mutex_unlock(&chip->open_mutex);
+       up(&chip->open_mutex);
        if (err < 0)
                return err;
        substream->runtime->hw.channels_max = chip->max_channels;
@@ -1069,9 +1068,9 @@ static int snd_atiixp_playback_close(struct snd_pcm_substream *substream)
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
-       mutex_lock(&chip->open_mutex);
+       down(&chip->open_mutex);
        err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
-       mutex_unlock(&chip->open_mutex);
+       up(&chip->open_mutex);
        return err;
 }
 
@@ -1091,12 +1090,12 @@ static int snd_atiixp_spdif_open(struct snd_pcm_substream *substream)
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
-       mutex_lock(&chip->open_mutex);
+       down(&chip->open_mutex);
        if (chip->spdif_over_aclink) /* share DMA_PLAYBACK */
                err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_PLAYBACK], 2);
        else
                err = snd_atiixp_pcm_open(substream, &chip->dmas[ATI_DMA_SPDIF], -1);
-       mutex_unlock(&chip->open_mutex);
+       up(&chip->open_mutex);
        return err;
 }
 
@@ -1104,12 +1103,12 @@ static int snd_atiixp_spdif_close(struct snd_pcm_substream *substream)
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        int err;
-       mutex_lock(&chip->open_mutex);
+       down(&chip->open_mutex);
        if (chip->spdif_over_aclink)
                err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_PLAYBACK]);
        else
                err = snd_atiixp_pcm_close(substream, &chip->dmas[ATI_DMA_SPDIF]);
-       mutex_unlock(&chip->open_mutex);
+       up(&chip->open_mutex);
        return err;
 }
 
@@ -1561,7 +1560,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card,
        }
 
        spin_lock_init(&chip->reg_lock);
-       mutex_init(&chip->open_mutex);
+       init_MUTEX(&chip->open_mutex);
        chip->card = card;
        chip->pci = pci;
        chip->irq = -1;