]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/isa/sb/sb8_main.c
ALSA: Kill snd_assert() in sound/isa/*
[linux-2.6-omap-h63xx.git] / sound / isa / sb / sb8_main.c
index aea9e5ec7b36eaaf3c6977665841e670acdf80b7..658d55769c9cd5ff44adf13aee830b455b215f5f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
+ *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  *                   Uros Bizjak <uros@kss-loka.si>
  *
  *  Routines for control of 8-bit SoundBlaster cards and clones
@@ -30,7 +30,6 @@
  *   Cleaned up and rewrote lowlevel routines.
  */
 
-#include <sound/driver.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 #include <linux/init.h>
@@ -38,7 +37,7 @@
 #include <sound/core.h>
 #include <sound/sb.h>
 
-MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>, Uros Bizjak <uros@kss-loka.si>");
+MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>, Uros Bizjak <uros@kss-loka.si>");
 MODULE_DESCRIPTION("Routines for control of 8-bit SoundBlaster cards and clones");
 MODULE_LICENSE("GPL");
 
@@ -112,7 +111,9 @@ static int snd_sb8_playback_prepare(struct snd_pcm_substream *substream)
        switch (chip->hardware) {
        case SB_HW_PRO:
                if (runtime->channels > 1) {
-                       snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL);
+                       if (snd_BUG_ON(rate != SB8_RATE(11025) &&
+                                      rate != SB8_RATE(22050)))
+                               return -EINVAL;
                        chip->playback_format = SB_DSP_HI_OUTPUT_AUTO;
                        break;
                }
@@ -238,7 +239,9 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
        switch (chip->hardware) {
        case SB_HW_PRO:
                if (runtime->channels > 1) {
-                       snd_assert(rate == SB8_RATE(11025) || rate == SB8_RATE(22050), return -EINVAL);
+                       if (snd_BUG_ON(rate != SB8_RATE(11025) &&
+                                      rate != SB8_RATE(22050)))
+                               return -EINVAL;
                        chip->capture_format = SB_DSP_HI_INPUT_AUTO;
                        break;
                }
@@ -278,7 +281,7 @@ static int snd_sb8_capture_prepare(struct snd_pcm_substream *substream)
        } else {
                snd_sbdsp_command(chip, 256 - runtime->rate_den);
        }
-       if (chip->capture_format != SB_DSP_OUTPUT) {
+       if (chip->capture_format != SB_DSP_INPUT) {
                count--;
                snd_sbdsp_command(chip, SB_DSP_BLOCK_SIZE);
                snd_sbdsp_command(chip, count & 0xff);