aboutsummaryrefslogtreecommitdiffstats
path: root/sound/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/sparc')
-rw-r--r--sound/sparc/amd7930.c19
-rw-r--r--sound/sparc/cs4231.c3
-rw-r--r--sound/sparc/dbri.c17
3 files changed, 15 insertions, 24 deletions
diff --git a/sound/sparc/amd7930.c b/sound/sparc/amd7930.c
index 5af5503edadb..f87933e48812 100644
--- a/sound/sparc/amd7930.c
+++ b/sound/sparc/amd7930.c
@@ -766,7 +766,6 @@ static int __devinit snd_amd7930_pcm(struct snd_amd7930 *amd)
766 /* playback count */ 1, 766 /* playback count */ 1,
767 /* capture count */ 1, &pcm)) < 0) 767 /* capture count */ 1, &pcm)) < 0)
768 return err; 768 return err;
769 snd_assert(pcm != NULL, return -EINVAL);
770 769
771 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_amd7930_playback_ops); 770 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_amd7930_playback_ops);
772 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops); 771 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_amd7930_capture_ops);
@@ -789,13 +788,6 @@ static int __devinit snd_amd7930_pcm(struct snd_amd7930 *amd)
789 788
790static int snd_amd7930_info_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo) 789static int snd_amd7930_info_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem_info *uinfo)
791{ 790{
792 int type = kctl->private_value;
793
794 snd_assert(type == VOLUME_MONITOR ||
795 type == VOLUME_CAPTURE ||
796 type == VOLUME_PLAYBACK, return -EINVAL);
797 (void) type;
798
799 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; 791 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
800 uinfo->count = 1; 792 uinfo->count = 1;
801 uinfo->value.integer.min = 0; 793 uinfo->value.integer.min = 0;
@@ -810,10 +802,6 @@ static int snd_amd7930_get_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem
810 int type = kctl->private_value; 802 int type = kctl->private_value;
811 int *swval; 803 int *swval;
812 804
813 snd_assert(type == VOLUME_MONITOR ||
814 type == VOLUME_CAPTURE ||
815 type == VOLUME_PLAYBACK, return -EINVAL);
816
817 switch (type) { 805 switch (type) {
818 case VOLUME_MONITOR: 806 case VOLUME_MONITOR:
819 swval = &amd->mgain; 807 swval = &amd->mgain;
@@ -839,10 +827,6 @@ static int snd_amd7930_put_volume(struct snd_kcontrol *kctl, struct snd_ctl_elem
839 int type = kctl->private_value; 827 int type = kctl->private_value;
840 int *swval, change; 828 int *swval, change;
841 829
842 snd_assert(type == VOLUME_MONITOR ||
843 type == VOLUME_CAPTURE ||
844 type == VOLUME_PLAYBACK, return -EINVAL);
845
846 switch (type) { 830 switch (type) {
847 case VOLUME_MONITOR: 831 case VOLUME_MONITOR:
848 swval = &amd->mgain; 832 swval = &amd->mgain;
@@ -905,7 +889,8 @@ static int __devinit snd_amd7930_mixer(struct snd_amd7930 *amd)
905 struct snd_card *card; 889 struct snd_card *card;
906 int idx, err; 890 int idx, err;
907 891
908 snd_assert(amd != NULL && amd->card != NULL, return -EINVAL); 892 if (snd_BUG_ON(!amd || !amd->card))
893 return -EINVAL;
909 894
910 card = amd->card; 895 card = amd->card;
911 strcpy(card->mixername, card->shortname); 896 strcpy(card->mixername, card->shortname);
diff --git a/sound/sparc/cs4231.c b/sound/sparc/cs4231.c
index 727438d276eb..d44bf98e965e 100644
--- a/sound/sparc/cs4231.c
+++ b/sound/sparc/cs4231.c
@@ -1543,7 +1543,8 @@ static int __init snd_cs4231_mixer(struct snd_card *card)
1543 struct snd_cs4231 *chip = card->private_data; 1543 struct snd_cs4231 *chip = card->private_data;
1544 int err, idx; 1544 int err, idx;
1545 1545
1546 snd_assert(chip != NULL && chip->pcm != NULL, return -EINVAL); 1546 if (snd_BUG_ON(!chip || !chip->pcm))
1547 return -EINVAL;
1547 1548
1548 strcpy(card->mixername, chip->pcm->name); 1549 strcpy(card->mixername, chip->pcm->name);
1549 1550
diff --git a/sound/sparc/dbri.c b/sound/sparc/dbri.c
index 2edb0ad3de7e..c257ad8bdfbc 100644
--- a/sound/sparc/dbri.c
+++ b/sound/sparc/dbri.c
@@ -2225,7 +2225,6 @@ static int __devinit snd_dbri_pcm(struct snd_card *card)
2225 /* playback count */ 1, 2225 /* playback count */ 1,
2226 /* capture count */ 1, &pcm)) < 0) 2226 /* capture count */ 1, &pcm)) < 0)
2227 return err; 2227 return err;
2228 snd_assert(pcm != NULL, return -EINVAL);
2229 2228
2230 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops); 2229 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops);
2231 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_dbri_ops); 2230 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_dbri_ops);
@@ -2265,9 +2264,10 @@ static int snd_cs4215_get_volume(struct snd_kcontrol *kcontrol,
2265{ 2264{
2266 struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol); 2265 struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
2267 struct dbri_streaminfo *info; 2266 struct dbri_streaminfo *info;
2268 snd_assert(dbri != NULL, return -EINVAL); 2267
2268 if (snd_BUG_ON(!dbri))
2269 return -EINVAL;
2269 info = &dbri->stream_info[kcontrol->private_value]; 2270 info = &dbri->stream_info[kcontrol->private_value];
2270 snd_assert(info != NULL, return -EINVAL);
2271 2271
2272 ucontrol->value.integer.value[0] = info->left_gain; 2272 ucontrol->value.integer.value[0] = info->left_gain;
2273 ucontrol->value.integer.value[1] = info->right_gain; 2273 ucontrol->value.integer.value[1] = info->right_gain;
@@ -2333,7 +2333,9 @@ static int snd_cs4215_get_single(struct snd_kcontrol *kcontrol,
2333 int shift = (kcontrol->private_value >> 8) & 0xff; 2333 int shift = (kcontrol->private_value >> 8) & 0xff;
2334 int mask = (kcontrol->private_value >> 16) & 0xff; 2334 int mask = (kcontrol->private_value >> 16) & 0xff;
2335 int invert = (kcontrol->private_value >> 24) & 1; 2335 int invert = (kcontrol->private_value >> 24) & 1;
2336 snd_assert(dbri != NULL, return -EINVAL); 2336
2337 if (snd_BUG_ON(!dbri))
2338 return -EINVAL;
2337 2339
2338 if (elem < 4) 2340 if (elem < 4)
2339 ucontrol->value.integer.value[0] = 2341 ucontrol->value.integer.value[0] =
@@ -2358,7 +2360,9 @@ static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol,
2358 int invert = (kcontrol->private_value >> 24) & 1; 2360 int invert = (kcontrol->private_value >> 24) & 1;
2359 int changed = 0; 2361 int changed = 0;
2360 unsigned short val; 2362 unsigned short val;
2361 snd_assert(dbri != NULL, return -EINVAL); 2363
2364 if (snd_BUG_ON(!dbri))
2365 return -EINVAL;
2362 2366
2363 val = (ucontrol->value.integer.value[0] & mask); 2367 val = (ucontrol->value.integer.value[0] & mask);
2364 if (invert == 1) 2368 if (invert == 1)
@@ -2434,7 +2438,8 @@ static int __devinit snd_dbri_mixer(struct snd_card *card)
2434 int idx, err; 2438 int idx, err;
2435 struct snd_dbri *dbri; 2439 struct snd_dbri *dbri;
2436 2440
2437 snd_assert(card != NULL && card->private_data != NULL, return -EINVAL); 2441 if (snd_BUG_ON(!card || !card->private_data))
2442 return -EINVAL;
2438 dbri = card->private_data; 2443 dbri = card->private_data;
2439 2444
2440 strcpy(card->mixername, card->shortname); 2445 strcpy(card->mixername, card->shortname);