diff options
Diffstat (limited to 'sound/sparc')
-rw-r--r-- | sound/sparc/amd7930.c | 19 | ||||
-rw-r--r-- | sound/sparc/cs4231.c | 3 | ||||
-rw-r--r-- | sound/sparc/dbri.c | 17 |
3 files changed, 15 insertions, 24 deletions
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c index 0c63e0585b15..49acee0c4840 100644 --- a/sound/sparc/amd7930.c +++ b/sound/sparc/amd7930.c | |||
@@ -765,7 +765,6 @@ static int __devinit snd_amd7930_pcm(struct snd_amd7930 *amd) | |||
765 | /* playback count */ 1, | 765 | /* playback count */ 1, |
766 | /* capture count */ 1, &pcm)) < 0) | 766 | /* capture count */ 1, &pcm)) < 0) |
767 | return err; | 767 | return err; |
768 | snd_assert(pcm != NULL, return -EINVAL); | ||
769 | 768 | ||
770 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_amd7930_playback_ops); | 769 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_amd7930_playback_ops); |
771 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops); | 770 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops); |
@@ -788,13 +787,6 @@ static int __devinit snd_amd7930_pcm(struct snd_amd7930 *amd) | |||
788 | 787 | ||
789 | static int snd_amd7930_info_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo) | 788 | static int snd_amd7930_info_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo) |
790 | { | 789 | { |
791 | int type = kctl->private_value; | ||
792 | |||
793 | snd_assert(type == VOLUME_MONITOR || | ||
794 | type == VOLUME_CAPTURE || | ||
795 | type == VOLUME_PLAYBACK, return -EINVAL); | ||
796 | (void) type; | ||
797 | |||
798 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 790 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
799 | uinfo->count = 1; | 791 | uinfo->count = 1; |
800 | uinfo->value.integer.min = 0; | 792 | uinfo->value.integer.min = 0; |
@@ -809,10 +801,6 @@ static int snd_amd7930_get_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem | |||
809 | int type = kctl->private_value; | 801 | int type = kctl->private_value; |
810 | int *swval; | 802 | int *swval; |
811 | 803 | ||
812 | snd_assert(type == VOLUME_MONITOR || | ||
813 | type == VOLUME_CAPTURE || | ||
814 | type == VOLUME_PLAYBACK, return -EINVAL); | ||
815 | |||
816 | switch (type) { | 804 | switch (type) { |
817 | case VOLUME_MONITOR: | 805 | case VOLUME_MONITOR: |
818 | swval = &amd->mgain; | 806 | swval = &amd->mgain; |
@@ -838,10 +826,6 @@ static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem | |||
838 | int type = kctl->private_value; | 826 | int type = kctl->private_value; |
839 | int *swval, change; | 827 | int *swval, change; |
840 | 828 | ||
841 | snd_assert(type == VOLUME_MONITOR || | ||
842 | type == VOLUME_CAPTURE || | ||
843 | type == VOLUME_PLAYBACK, return -EINVAL); | ||
844 | |||
845 | switch (type) { | 829 | switch (type) { |
846 | case VOLUME_MONITOR: | 830 | case VOLUME_MONITOR: |
847 | swval = &amd->mgain; | 831 | swval = &amd->mgain; |
@@ -904,7 +888,8 @@ static int __devinit snd_amd7930_mixer(struct snd_amd7930 *amd) | |||
904 | struct snd_card *card; | 888 | struct snd_card *card; |
905 | int idx, err; | 889 | int idx, err; |
906 | 890 | ||
907 | snd_assert(amd != NULL && amd->card != NULL, return -EINVAL); | 891 | if (snd_BUG_ON(!amd || !amd->card)) |
892 | return -EINVAL; | ||
908 | 893 | ||
909 | card = amd->card; | 894 | card = amd->card; |
910 | strcpy(card->mixername, card->shortname); | 895 | strcpy(card->mixername, card->shortname); |
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c index 1c4797be72ee..791d2fb821d1 100644 --- a/sound/sparc/cs4231.c +++ b/sound/sparc/cs4231.c | |||
@@ -1560,7 +1560,8 @@ static int __init snd_cs4231_mixer(struct snd_card *card) | |||
1560 | struct snd_cs4231 *chip = card->private_data; | 1560 | struct snd_cs4231 *chip = card->private_data; |
1561 | int err, idx; | 1561 | int err, idx; |
1562 | 1562 | ||
1563 | snd_assert(chip != NULL && chip->pcm != NULL, return -EINVAL); | 1563 | if (snd_BUG_ON(!chip || !chip->pcm)) |
1564 | return -EINVAL; | ||
1564 | 1565 | ||
1565 | strcpy(card->mixername, chip->pcm->name); | 1566 | strcpy(card->mixername, chip->pcm->name); |
1566 | 1567 | ||
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c index ee2e1b4f3551..c534a2a849fa 100644 --- a/sound/sparc/dbri.c +++ b/sound/sparc/dbri.c | |||
@@ -2223,7 +2223,6 @@ static int __devinit snd_dbri_pcm(struct snd_card *card) | |||
2223 | /* playback count */ 1, | 2223 | /* playback count */ 1, |
2224 | /* capture count */ 1, &pcm)) < 0) | 2224 | /* capture count */ 1, &pcm)) < 0) |
2225 | return err; | 2225 | return err; |
2226 | snd_assert(pcm != NULL, return -EINVAL); | ||
2227 | 2226 | ||
2228 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops); | 2227 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops); |
2229 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_dbri_ops); | 2228 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_dbri_ops); |
@@ -2263,9 +2262,10 @@ static int snd_cs4215_get_volume(struct snd_kcontrol *kcontrol, | |||
2263 | { | 2262 | { |
2264 | struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); | 2263 | struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); |
2265 | struct dbri_streaminfo *info; | 2264 | struct dbri_streaminfo *info; |
2266 | snd_assert(dbri != NULL, return -EINVAL); | 2265 | |
2266 | if (snd_BUG_ON(!dbri)) | ||
2267 | return -EINVAL; | ||
2267 | info = &dbri->stream_info[kcontrol->private_value]; | 2268 | info = &dbri->stream_info[kcontrol->private_value]; |
2268 | snd_assert(info != NULL, return -EINVAL); | ||
2269 | 2269 | ||
2270 | ucontrol->value.integer.value[0] = info->left_gain; | 2270 | ucontrol->value.integer.value[0] = info->left_gain; |
2271 | ucontrol->value.integer.value[1] = info->right_gain; | 2271 | ucontrol->value.integer.value[1] = info->right_gain; |
@@ -2331,7 +2331,9 @@ static int snd_cs4215_get_single(struct snd_kcontrol *kcontrol, | |||
2331 | int shift = (kcontrol->private_value >> 8) & 0xff; | 2331 | int shift = (kcontrol->private_value >> 8) & 0xff; |
2332 | int mask = (kcontrol->private_value >> 16) & 0xff; | 2332 | int mask = (kcontrol->private_value >> 16) & 0xff; |
2333 | int invert = (kcontrol->private_value >> 24) & 1; | 2333 | int invert = (kcontrol->private_value >> 24) & 1; |
2334 | snd_assert(dbri != NULL, return -EINVAL); | 2334 | |
2335 | if (snd_BUG_ON(!dbri)) | ||
2336 | return -EINVAL; | ||
2335 | 2337 | ||
2336 | if (elem < 4) | 2338 | if (elem < 4) |
2337 | ucontrol->value.integer.value[0] = | 2339 | ucontrol->value.integer.value[0] = |
@@ -2356,7 +2358,9 @@ static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol, | |||
2356 | int invert = (kcontrol->private_value >> 24) & 1; | 2358 | int invert = (kcontrol->private_value >> 24) & 1; |
2357 | int changed = 0; | 2359 | int changed = 0; |
2358 | unsigned short val; | 2360 | unsigned short val; |
2359 | snd_assert(dbri != NULL, return -EINVAL); | 2361 | |
2362 | if (snd_BUG_ON(!dbri)) | ||
2363 | return -EINVAL; | ||
2360 | 2364 | ||
2361 | val = (ucontrol->value.integer.value[0] & mask); | 2365 | val = (ucontrol->value.integer.value[0] & mask); |
2362 | if (invert == 1) | 2366 | if (invert == 1) |
@@ -2432,7 +2436,8 @@ static int __devinit snd_dbri_mixer(struct snd_card *card) | |||
2432 | int idx, err; | 2436 | int idx, err; |
2433 | struct snd_dbri *dbri; | 2437 | struct snd_dbri *dbri; |
2434 | 2438 | ||
2435 | snd_assert(card != NULL && card->private_data != NULL, return -EINVAL); | 2439 | if (snd_BUG_ON(!card || !card->private_data)) |
2440 | return -EINVAL; | ||
2436 | dbri = card->private_data; | 2441 | dbri = card->private_data; |
2437 | 2442 | ||
2438 | strcpy(card->mixername, card->shortname); | 2443 | strcpy(card->mixername, card->shortname); |