ASoC: Fix null string usage with WM8753 DAIs
[safe/jmp/linux-2.6] / sound / pci / cmipci.c
index bc0a195..1a74ca6 100644 (file)
@@ -20,7 +20,6 @@
 /* Does not work. Warning may block system in capture mode */
 /* #define USE_VAR48KRATE */
 
-#include <sound/driver.h>
 #include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
@@ -2358,7 +2357,8 @@ static int snd_cmipci_uswitch_get(struct snd_kcontrol *kcontrol,
 {
        struct cmipci_switch_args *args;
        args = (struct cmipci_switch_args *)kcontrol->private_value;
-       snd_assert(args != NULL, return -EINVAL);
+       if (snd_BUG_ON(!args))
+               return -EINVAL;
        return _snd_cmipci_uswitch_get(kcontrol, ucontrol, args);
 }
 
@@ -2402,7 +2402,8 @@ static int snd_cmipci_uswitch_put(struct snd_kcontrol *kcontrol,
 {
        struct cmipci_switch_args *args;
        args = (struct cmipci_switch_args *)kcontrol->private_value;
-       snd_assert(args != NULL, return -EINVAL);
+       if (snd_BUG_ON(!args))
+               return -EINVAL;
        return _snd_cmipci_uswitch_put(kcontrol, ucontrol, args);
 }
 
@@ -2663,7 +2664,8 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
        unsigned int idx;
        int err;
 
-       snd_assert(cm != NULL && cm->card != NULL, return -EINVAL);
+       if (snd_BUG_ON(!cm || !cm->card))
+               return -EINVAL;
 
        card = cm->card;
 
@@ -2745,12 +2747,13 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
        }
 
        for (idx = 0; idx < CM_SAVED_MIXERS; idx++) {
-               struct snd_ctl_elem_id id;
+               struct snd_ctl_elem_id elem_id;
                struct snd_kcontrol *ctl;
-               memset(&id, 0, sizeof(id));
-               id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
-               strcpy(id.name, cm_saved_mixer[idx].name);
-               if ((ctl = snd_ctl_find_id(cm->card, &id)) != NULL)
+               memset(&elem_id, 0, sizeof(elem_id));
+               elem_id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
+               strcpy(elem_id.name, cm_saved_mixer[idx].name);
+               ctl = snd_ctl_find_id(cm->card, &elem_id);
+               if (ctl)
                        cm->mixer_res_ctl[idx] = ctl;
        }
 
@@ -2933,8 +2936,6 @@ static int snd_cmipci_free(struct cmipci *cm)
                /* reset mixer */
                snd_cmipci_mixer_write(cm, 0, 0);
 
-               synchronize_irq(cm->irq);
-
                free_irq(cm->irq, cm);
        }