aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/awacs.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-08-08 11:12:47 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-13 05:46:40 -0400
commit5e246b850df563224be26f1d409cf66fd6c968df (patch)
tree970e7faf60b86cb2c489a08ca506075c398165e5 /sound/ppc/awacs.c
parentda3cec35dd3c31d8706db4bf379372ce70d92118 (diff)
ALSA: Kill snd_assert() in other places
Kill snd_assert() in other places, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/ppc/awacs.c')
-rw-r--r--sound/ppc/awacs.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/sound/ppc/awacs.c b/sound/ppc/awacs.c
index 106c48225bba..7bd33e6552ab 100644
--- a/sound/ppc/awacs.c
+++ b/sound/ppc/awacs.c
@@ -319,7 +319,8 @@ static void awacs_amp_set_master(struct awacs_amp *amp, int vol)
319static void awacs_amp_free(struct snd_pmac *chip) 319static void awacs_amp_free(struct snd_pmac *chip)
320{ 320{
321 struct awacs_amp *amp = chip->mixer_data; 321 struct awacs_amp *amp = chip->mixer_data;
322 snd_assert(amp, return); 322 if (!amp)
323 return;
323 kfree(amp); 324 kfree(amp);
324 chip->mixer_data = NULL; 325 chip->mixer_data = NULL;
325 chip->mixer_free = NULL; 326 chip->mixer_free = NULL;
@@ -345,8 +346,7 @@ static int snd_pmac_awacs_get_volume_amp(struct snd_kcontrol *kcontrol,
345 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 346 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
346 int index = kcontrol->private_value; 347 int index = kcontrol->private_value;
347 struct awacs_amp *amp = chip->mixer_data; 348 struct awacs_amp *amp = chip->mixer_data;
348 snd_assert(amp, return -EINVAL); 349
349 snd_assert(index >= 0 && index <= 1, return -EINVAL);
350 ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31); 350 ucontrol->value.integer.value[0] = 31 - (amp->amp_vol[index][0] & 31);
351 ucontrol->value.integer.value[1] = 31 - (amp->amp_vol[index][1] & 31); 351 ucontrol->value.integer.value[1] = 31 - (amp->amp_vol[index][1] & 31);
352 return 0; 352 return 0;
@@ -359,8 +359,6 @@ static int snd_pmac_awacs_put_volume_amp(struct snd_kcontrol *kcontrol,
359 int index = kcontrol->private_value; 359 int index = kcontrol->private_value;
360 int vol[2]; 360 int vol[2];
361 struct awacs_amp *amp = chip->mixer_data; 361 struct awacs_amp *amp = chip->mixer_data;
362 snd_assert(amp, return -EINVAL);
363 snd_assert(index >= 0 && index <= 1, return -EINVAL);
364 362
365 vol[0] = (31 - (ucontrol->value.integer.value[0] & 31)) 363 vol[0] = (31 - (ucontrol->value.integer.value[0] & 31))
366 | (amp->amp_vol[index][0] & 32); 364 | (amp->amp_vol[index][0] & 32);
@@ -375,8 +373,7 @@ static int snd_pmac_awacs_get_switch_amp(struct snd_kcontrol *kcontrol,
375 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 373 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
376 int index = kcontrol->private_value; 374 int index = kcontrol->private_value;
377 struct awacs_amp *amp = chip->mixer_data; 375 struct awacs_amp *amp = chip->mixer_data;
378 snd_assert(amp, return -EINVAL); 376
379 snd_assert(index >= 0 && index <= 1, return -EINVAL);
380 ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32) 377 ucontrol->value.integer.value[0] = (amp->amp_vol[index][0] & 32)
381 ? 0 : 1; 378 ? 0 : 1;
382 ucontrol->value.integer.value[1] = (amp->amp_vol[index][1] & 32) 379 ucontrol->value.integer.value[1] = (amp->amp_vol[index][1] & 32)
@@ -391,8 +388,6 @@ static int snd_pmac_awacs_put_switch_amp(struct snd_kcontrol *kcontrol,
391 int index = kcontrol->private_value; 388 int index = kcontrol->private_value;
392 int vol[2]; 389 int vol[2];
393 struct awacs_amp *amp = chip->mixer_data; 390 struct awacs_amp *amp = chip->mixer_data;
394 snd_assert(amp, return -EINVAL);
395 snd_assert(index >= 0 && index <= 1, return -EINVAL);
396 391
397 vol[0] = (ucontrol->value.integer.value[0] ? 0 : 32) 392 vol[0] = (ucontrol->value.integer.value[0] ? 0 : 32)
398 | (amp->amp_vol[index][0] & 31); 393 | (amp->amp_vol[index][0] & 31);
@@ -417,8 +412,7 @@ static int snd_pmac_awacs_get_tone_amp(struct snd_kcontrol *kcontrol,
417 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 412 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
418 int index = kcontrol->private_value; 413 int index = kcontrol->private_value;
419 struct awacs_amp *amp = chip->mixer_data; 414 struct awacs_amp *amp = chip->mixer_data;
420 snd_assert(amp, return -EINVAL); 415
421 snd_assert(index >= 0 && index <= 1, return -EINVAL);
422 ucontrol->value.integer.value[0] = amp->amp_tone[index]; 416 ucontrol->value.integer.value[0] = amp->amp_tone[index];
423 return 0; 417 return 0;
424} 418}
@@ -430,8 +424,7 @@ static int snd_pmac_awacs_put_tone_amp(struct snd_kcontrol *kcontrol,
430 int index = kcontrol->private_value; 424 int index = kcontrol->private_value;
431 struct awacs_amp *amp = chip->mixer_data; 425 struct awacs_amp *amp = chip->mixer_data;
432 unsigned int val; 426 unsigned int val;
433 snd_assert(amp, return -EINVAL); 427
434 snd_assert(index >= 0 && index <= 1, return -EINVAL);
435 val = ucontrol->value.integer.value[0]; 428 val = ucontrol->value.integer.value[0];
436 if (val > 14) 429 if (val > 14)
437 return -EINVAL; 430 return -EINVAL;
@@ -458,7 +451,7 @@ static int snd_pmac_awacs_get_master_amp(struct snd_kcontrol *kcontrol,
458{ 451{
459 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 452 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
460 struct awacs_amp *amp = chip->mixer_data; 453 struct awacs_amp *amp = chip->mixer_data;
461 snd_assert(amp, return -EINVAL); 454
462 ucontrol->value.integer.value[0] = amp->amp_master; 455 ucontrol->value.integer.value[0] = amp->amp_master;
463 return 0; 456 return 0;
464} 457}
@@ -469,7 +462,7 @@ static int snd_pmac_awacs_put_master_amp(struct snd_kcontrol *kcontrol,
469 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 462 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
470 struct awacs_amp *amp = chip->mixer_data; 463 struct awacs_amp *amp = chip->mixer_data;
471 unsigned int val; 464 unsigned int val;
472 snd_assert(amp, return -EINVAL); 465
473 val = ucontrol->value.integer.value[0]; 466 val = ucontrol->value.integer.value[0];
474 if (val > 99) 467 if (val > 99)
475 return -EINVAL; 468 return -EINVAL;