]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - sound/sparc/dbri.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6
[mv-sheeva.git] / sound / sparc / dbri.c
index 2edb0ad3de7e7f640840828b43b586152ee685cc..23ed6f04a718c30d30db22e577974c4ee54f8190 100644 (file)
@@ -2225,7 +2225,6 @@ static int __devinit snd_dbri_pcm(struct snd_card *card)
                               /* playback count */ 1,
                               /* capture count */  1, &pcm)) < 0)
                return err;
-       snd_assert(pcm != NULL, return -EINVAL);
 
        snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_dbri_ops);
        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,
 {
        struct snd_dbri *dbri = snd_kcontrol_chip(kcontrol);
        struct dbri_streaminfo *info;
-       snd_assert(dbri != NULL, return -EINVAL);
+
+       if (snd_BUG_ON(!dbri))
+               return -EINVAL;
        info = &dbri->stream_info[kcontrol->private_value];
-       snd_assert(info != NULL, return -EINVAL);
 
        ucontrol->value.integer.value[0] = info->left_gain;
        ucontrol->value.integer.value[1] = info->right_gain;
@@ -2333,7 +2333,9 @@ static int snd_cs4215_get_single(struct snd_kcontrol *kcontrol,
        int shift = (kcontrol->private_value >> 8) & 0xff;
        int mask = (kcontrol->private_value >> 16) & 0xff;
        int invert = (kcontrol->private_value >> 24) & 1;
-       snd_assert(dbri != NULL, return -EINVAL);
+
+       if (snd_BUG_ON(!dbri))
+               return -EINVAL;
 
        if (elem < 4)
                ucontrol->value.integer.value[0] =
@@ -2358,7 +2360,9 @@ static int snd_cs4215_put_single(struct snd_kcontrol *kcontrol,
        int invert = (kcontrol->private_value >> 24) & 1;
        int changed = 0;
        unsigned short val;
-       snd_assert(dbri != NULL, return -EINVAL);
+
+       if (snd_BUG_ON(!dbri))
+               return -EINVAL;
 
        val = (ucontrol->value.integer.value[0] & mask);
        if (invert == 1)
@@ -2434,7 +2438,8 @@ static int __devinit snd_dbri_mixer(struct snd_card *card)
        int idx, err;
        struct snd_dbri *dbri;
 
-       snd_assert(card != NULL && card->private_data != NULL, return -EINVAL);
+       if (snd_BUG_ON(!card || !card->private_data))
+               return -EINVAL;
        dbri = card->private_data;
 
        strcpy(card->mixername, card->shortname);
@@ -2529,6 +2534,8 @@ static int __devinit snd_dbri_create(struct snd_card *card,
        dbri->dma = dma_alloc_coherent(&op->dev,
                                       sizeof(struct dbri_dma),
                                       &dbri->dma_dvma, GFP_ATOMIC);
+       if (!dbri->dma)
+               return -ENOMEM;
        memset((void *)dbri->dma, 0, sizeof(struct dbri_dma));
 
        dprintk(D_GEN, "DMA Cmd Block 0x%p (0x%08x)\n",