aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/pmac.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-10-10 05:46:31 -0400
committerJaroslav Kysela <perex@suse.cz>2005-11-04 07:17:42 -0500
commit7c22f1aaa23370bf9ba2dd3abbccbed70dced216 (patch)
treeebc9c1e5cfdab4815afdfab1ba583e6220287252 /sound/ppc/pmac.c
parentf01cc521a2abef5dba24fb0873b9626ba6b0a0a5 (diff)
[ALSA] Remove snd_runtime_check() macro
Remove snd_runtime_check() macro. This macro worsens the readability of codes. They should be either normal if() or removable asserts. Also, the assert displays stack-dump, instead of only the last caller pointer. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/ppc/pmac.c')
-rw-r--r--sound/ppc/pmac.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 392b2abd9f13..db2f1815fc30 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -220,7 +220,8 @@ static int snd_pmac_pcm_prepare(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substr
220 220
221 /* set up constraints */ 221 /* set up constraints */
222 astr = snd_pmac_get_stream(chip, another_stream(rec->stream)); 222 astr = snd_pmac_get_stream(chip, another_stream(rec->stream));
223 snd_runtime_check(astr, return -EINVAL); 223 if (! astr)
224 return -EINVAL;
224 astr->cur_freqs = 1 << rate_index; 225 astr->cur_freqs = 1 << rate_index;
225 astr->cur_formats = 1 << runtime->format; 226 astr->cur_formats = 1 << runtime->format;
226 chip->rate_index = rate_index; 227 chip->rate_index = rate_index;
@@ -467,7 +468,8 @@ static int snd_pmac_hw_rule_rate(snd_pcm_hw_params_t *params,
467 pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]); 468 pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]);
468 int i, freq_table[8], num_freqs; 469 int i, freq_table[8], num_freqs;
469 470
470 snd_runtime_check(rec, return -EINVAL); 471 if (! rec)
472 return -EINVAL;
471 num_freqs = 0; 473 num_freqs = 0;
472 for (i = chip->num_freqs - 1; i >= 0; i--) { 474 for (i = chip->num_freqs - 1; i >= 0; i--) {
473 if (rec->cur_freqs & (1 << i)) 475 if (rec->cur_freqs & (1 << i))
@@ -484,7 +486,8 @@ static int snd_pmac_hw_rule_format(snd_pcm_hw_params_t *params,
484 pmac_t *chip = rule->private; 486 pmac_t *chip = rule->private;
485 pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]); 487 pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]);
486 488
487 snd_runtime_check(rec, return -EINVAL); 489 if (! rec)
490 return -EINVAL;
488 return snd_mask_refine_set(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT), 491 return snd_mask_refine_set(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT),
489 rec->cur_formats); 492 rec->cur_formats);
490} 493}
@@ -569,7 +572,8 @@ static int snd_pmac_pcm_close(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substrea
569 snd_pmac_dma_stop(rec); 572 snd_pmac_dma_stop(rec);
570 573
571 astr = snd_pmac_get_stream(chip, another_stream(rec->stream)); 574 astr = snd_pmac_get_stream(chip, another_stream(rec->stream));
572 snd_runtime_check(astr, return -EINVAL); 575 if (! astr)
576 return -EINVAL;
573 577
574 /* reset constraints */ 578 /* reset constraints */
575 astr->cur_freqs = chip->freqs_ok; 579 astr->cur_freqs = chip->freqs_ok;
@@ -1158,7 +1162,6 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return)
1158 .dev_free = snd_pmac_dev_free, 1162 .dev_free = snd_pmac_dev_free,
1159 }; 1163 };
1160 1164
1161 snd_runtime_check(chip_return, return -EINVAL);
1162 *chip_return = NULL; 1165 *chip_return = NULL;
1163 1166
1164 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1167 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
@@ -1382,7 +1385,8 @@ static int snd_pmac_sleep_notify(struct pmu_sleep_notifier *self, int when)
1382 pmac_t *chip; 1385 pmac_t *chip;
1383 1386
1384 chip = sleeping_pmac; 1387 chip = sleeping_pmac;
1385 snd_runtime_check(chip, return 0); 1388 if (! chip)
1389 return 0;
1386 1390
1387 switch (when) { 1391 switch (when) {
1388 case PBOOK_SLEEP_NOW: 1392 case PBOOK_SLEEP_NOW: