diff options
Diffstat (limited to 'sound/pci/echoaudio/echoaudio_3g.c')
-rw-r--r-- | sound/pci/echoaudio/echoaudio_3g.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/pci/echoaudio/echoaudio_3g.c b/sound/pci/echoaudio/echoaudio_3g.c index 52a93318957..c3736bbd819 100644 --- a/sound/pci/echoaudio/echoaudio_3g.c +++ b/sound/pci/echoaudio/echoaudio_3g.c | |||
@@ -103,9 +103,11 @@ static int set_digital_mode(struct echoaudio *chip, u8 mode) | |||
103 | int err, i, o; | 103 | int err, i, o; |
104 | 104 | ||
105 | /* All audio channels must be closed before changing the digital mode */ | 105 | /* All audio channels must be closed before changing the digital mode */ |
106 | snd_assert(!chip->pipe_alloc_mask, return -EAGAIN); | 106 | if (snd_BUG_ON(chip->pipe_alloc_mask)) |
107 | return -EAGAIN; | ||
107 | 108 | ||
108 | snd_assert(chip->digital_modes & (1 << mode), return -EINVAL); | 109 | if (snd_BUG_ON(!(chip->digital_modes & (1 << mode)))) |
110 | return -EINVAL; | ||
109 | 111 | ||
110 | previous_mode = chip->digital_mode; | 112 | previous_mode = chip->digital_mode; |
111 | err = dsp_set_digital_mode(chip, mode); | 113 | err = dsp_set_digital_mode(chip, mode); |
@@ -267,8 +269,9 @@ static int set_sample_rate(struct echoaudio *chip, u32 rate) | |||
267 | return 0; | 269 | return 0; |
268 | } | 270 | } |
269 | 271 | ||
270 | snd_assert(rate < 50000 || chip->digital_mode != DIGITAL_MODE_ADAT, | 272 | if (snd_BUG_ON(rate >= 50000 && |
271 | return -EINVAL); | 273 | chip->digital_mode == DIGITAL_MODE_ADAT)) |
274 | return -EINVAL; | ||
272 | 275 | ||
273 | clock = 0; | 276 | clock = 0; |
274 | control_reg = le32_to_cpu(chip->comm_page->control_register); | 277 | control_reg = le32_to_cpu(chip->comm_page->control_register); |