]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/atiixp.c
ALSA: Kill snd_assert() in sound/pci/*
[linux-2.6-omap-h63xx.git] / sound / pci / atiixp.c
index 457228fb22aad76dee9fafb9950d85c80acfd73c..ce1eb12768f4cfb99f06fe1b69beb3bfa0284324 100644 (file)
@@ -722,7 +722,9 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
        struct atiixp_dma *dma = substream->runtime->private_data;
        int err = 0;
 
-       snd_assert(dma->ops->enable_transfer && dma->ops->flush_dma, return -EINVAL);
+       if (snd_BUG_ON(!dma->ops->enable_transfer ||
+                      !dma->ops->flush_dma))
+               return -EINVAL;
 
        spin_lock(&chip->reg_lock);
        switch (cmd) {
@@ -1032,7 +1034,8 @@ static int snd_atiixp_pcm_open(struct snd_pcm_substream *substream,
        struct snd_pcm_runtime *runtime = substream->runtime;
        int err;
 
-       snd_assert(dma->ops && dma->ops->enable_dma, return -EINVAL);
+       if (snd_BUG_ON(!dma->ops || !dma->ops->enable_dma))
+               return -EINVAL;
 
        if (dma->opened)
                return -EBUSY;
@@ -1064,7 +1067,8 @@ static int snd_atiixp_pcm_close(struct snd_pcm_substream *substream,
 {
        struct atiixp *chip = snd_pcm_substream_chip(substream);
        /* disable DMA bits */
-       snd_assert(dma->ops && dma->ops->enable_dma, return -EINVAL);
+       if (snd_BUG_ON(!dma->ops || !dma->ops->enable_dma))
+               return -EINVAL;
        spin_lock_irq(&chip->reg_lock);
        dma->ops->enable_dma(chip, 0);
        spin_unlock_irq(&chip->reg_lock);