diff options
Diffstat (limited to 'sound/ppc')
-rw-r--r-- | sound/ppc/beep.c | 2 | ||||
-rw-r--r-- | sound/ppc/pmac.c | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c index 1681ee13efbb..d4ec6cc3f1c5 100644 --- a/sound/ppc/beep.c +++ b/sound/ppc/beep.c | |||
@@ -171,8 +171,6 @@ static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, unsigne | |||
171 | * beep volume mixer | 171 | * beep volume mixer |
172 | */ | 172 | */ |
173 | 173 | ||
174 | #define chip_t pmac_t | ||
175 | |||
176 | static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) | 174 | static int snd_pmac_info_beep(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo) |
177 | { | 175 | { |
178 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 176 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
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: |