aboutsummaryrefslogtreecommitdiffstats
path: root/sound/sparc/dbri.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/sparc/dbri.c')
-rw-r--r--sound/sparc/dbri.c17
1 files changed, 11 insertions, 6 deletions
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);