diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 19:09:02 +0300 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-07 19:09:02 +0300 |
commit | 8f0cb147b2fb12427bf6abef7fed2b604557a41e (patch) | |
tree | fb5ba437ee74b900fab9686c8c7df18abcd7640b /sound/ppc/pmac.c | |
parent | 8e33ba49765484bc6de3a2f8143733713fa93bc1 (diff) | |
parent | b00e8443c3eece823052d06ae1c7cb797ab0ddf5 (diff) | |
download | linux-8f0cb147b2fb12427bf6abef7fed2b604557a41e.tar.xz |
Merge master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
Diffstat (limited to 'sound/ppc/pmac.c')
-rw-r--r-- | sound/ppc/pmac.c | 16 |
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 /* set up constraints */ astr = snd_pmac_get_stream(chip, another_stream(rec->stream)); - snd_runtime_check(astr, return -EINVAL); + if (! astr) + return -EINVAL; astr->cur_freqs = 1 << rate_index; astr->cur_formats = 1 << runtime->format; chip->rate_index = rate_index; @@ -467,7 +468,8 @@ static int snd_pmac_hw_rule_rate(snd_pcm_hw_params_t *params, pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]); int i, freq_table[8], num_freqs; - snd_runtime_check(rec, return -EINVAL); + if (! rec) + return -EINVAL; num_freqs = 0; for (i = chip->num_freqs - 1; i >= 0; i--) { if (rec->cur_freqs & (1 << i)) @@ -484,7 +486,8 @@ static int snd_pmac_hw_rule_format(snd_pcm_hw_params_t *params, pmac_t *chip = rule->private; pmac_stream_t *rec = snd_pmac_get_stream(chip, rule->deps[0]); - snd_runtime_check(rec, return -EINVAL); + if (! rec) + return -EINVAL; return snd_mask_refine_set(hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT), rec->cur_formats); } @@ -569,7 +572,8 @@ static int snd_pmac_pcm_close(pmac_t *chip, pmac_stream_t *rec, snd_pcm_substrea snd_pmac_dma_stop(rec); astr = snd_pmac_get_stream(chip, another_stream(rec->stream)); - snd_runtime_check(astr, return -EINVAL); + if (! astr) + return -EINVAL; /* reset constraints */ astr->cur_freqs = chip->freqs_ok; @@ -1158,7 +1162,6 @@ int __init snd_pmac_new(snd_card_t *card, pmac_t **chip_return) .dev_free = snd_pmac_dev_free, }; - snd_runtime_check(chip_return, return -EINVAL); *chip_return = NULL; chip = kzalloc(sizeof(*chip), GFP_KERNEL); @@ -1382,7 +1385,8 @@ static int snd_pmac_sleep_notify(struct pmu_sleep_notifier *self, int when) pmac_t *chip; chip = sleeping_pmac; - snd_runtime_check(chip, return 0); + if (! chip) + return 0; switch (when) { case PBOOK_SLEEP_NOW: |