aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/echoaudio/layla20_dsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/echoaudio/layla20_dsp.c')
-rw-r--r--sound/pci/echoaudio/layla20_dsp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/pci/echoaudio/layla20_dsp.c b/sound/pci/echoaudio/layla20_dsp.c
index 990c9a60a0a..ede75c6ca0f 100644
--- a/sound/pci/echoaudio/layla20_dsp.c
+++ b/sound/pci/echoaudio/layla20_dsp.c
@@ -42,7 +42,8 @@ static int init_hw(struct echoaudio *chip, u16 device_id, u16 subdevice_id)
42 int err; 42 int err;
43 43
44 DE_INIT(("init_hw() - Layla20\n")); 44 DE_INIT(("init_hw() - Layla20\n"));
45 snd_assert((subdevice_id & 0xfff0) == LAYLA20, return -ENODEV); 45 if (snd_BUG_ON((subdevice_id & 0xfff0) != LAYLA20))
46 return -ENODEV;
46 47
47 if ((err = init_dsp_comm_page(chip))) { 48 if ((err = init_dsp_comm_page(chip))) {
48 DE_INIT(("init_hw - could not initialize DSP comm page\n")); 49 DE_INIT(("init_hw - could not initialize DSP comm page\n"));
@@ -155,7 +156,8 @@ static int load_asic(struct echoaudio *chip)
155 156
156static int set_sample_rate(struct echoaudio *chip, u32 rate) 157static int set_sample_rate(struct echoaudio *chip, u32 rate)
157{ 158{
158 snd_assert(rate >= 8000 && rate <= 50000, return -EINVAL); 159 if (snd_BUG_ON(rate < 8000 || rate > 50000))
160 return -EINVAL;
159 161
160 /* Only set the clock for internal mode. Do not return failure, 162 /* Only set the clock for internal mode. Do not return failure,
161 simply treat it as a non-event. */ 163 simply treat it as a non-event. */
@@ -252,7 +254,8 @@ static int set_output_clock(struct echoaudio *chip, u16 clock)
252/* Set input bus gain (one unit is 0.5dB !) */ 254/* Set input bus gain (one unit is 0.5dB !) */
253static int set_input_gain(struct echoaudio *chip, u16 input, int gain) 255static int set_input_gain(struct echoaudio *chip, u16 input, int gain)
254{ 256{
255 snd_assert(input < num_busses_in(chip), return -EINVAL); 257 if (snd_BUG_ON(input >= num_busses_in(chip)))
258 return -EINVAL;
256 259
257 if (wait_handshake(chip)) 260 if (wait_handshake(chip))
258 return -EIO; 261 return -EIO;