]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/pci/hda/hda_generic.c
ALSA: hda - Add forgotten module alias for Nvidia MCP67 HDMI
[linux-2.6-omap-h63xx.git] / sound / pci / hda / hda_generic.c
index 59e4389c94a4bb87b1aa85075d2d127e5ae542da..65745e96dc701d91cb5bcbf31b883e80f53791e9 100644 (file)
@@ -174,7 +174,8 @@ static int build_afg_tree(struct hda_codec *codec)
        int i, nodes, err;
        hda_nid_t nid;
 
-       snd_assert(spec, return -EINVAL);
+       if (snd_BUG_ON(!spec))
+               return -EINVAL;
 
        spec->def_amp_out_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_OUT_CAP);
        spec->def_amp_in_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_IN_CAP);
@@ -722,7 +723,8 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node,
                if (is_loopback)
                        add_input_loopback(codec, node->nid, HDA_INPUT, index);
                snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index);
-               if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0)
+               err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
+               if (err < 0)
                        return err;
                created = 1;
        } else if ((node->wid_caps & AC_WCAP_OUT_AMP) &&
@@ -731,7 +733,8 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node,
                if (is_loopback)
                        add_input_loopback(codec, node->nid, HDA_OUTPUT, 0);
                snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid);
-               if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0)
+               err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
+               if (err < 0)
                        return err;
                created = 1;
        }
@@ -744,14 +747,16 @@ static int create_mixer(struct hda_codec *codec, struct hda_gnode *node,
            (node->amp_in_caps & AC_AMPCAP_NUM_STEPS)) {
                knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, index, HDA_INPUT);
                snd_printdd("[%s] NID=0x%x, DIR=IN, IDX=0x%x\n", name, node->nid, index);
-               if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0)
+               err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
+               if (err < 0)
                        return err;
                created = 1;
        } else if ((node->wid_caps & AC_WCAP_OUT_AMP) &&
                   (node->amp_out_caps & AC_AMPCAP_NUM_STEPS)) {
                knew = (struct snd_kcontrol_new)HDA_CODEC_VOLUME(name, node->nid, 0, HDA_OUTPUT);
                snd_printdd("[%s] NID=0x%x, DIR=OUT\n", name, node->nid);
-               if ((err = snd_ctl_add(codec->bus->card, snd_ctl_new1(&knew, codec))) < 0)
+               err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
+               if (err < 0)
                        return err;
                created = 1;
        }
@@ -848,8 +853,8 @@ static int build_input_controls(struct hda_codec *codec)
        }
 
        /* create input MUX if multiple sources are available */
-       if ((err = snd_ctl_add(codec->bus->card,
-                              snd_ctl_new1(&cap_sel, codec))) < 0)
+       err = snd_hda_ctl_add(codec, snd_ctl_new1(&cap_sel, codec));
+       if (err < 0)
                return err;
 
        /* no volume control? */
@@ -866,8 +871,8 @@ static int build_input_controls(struct hda_codec *codec)
                        HDA_CODEC_VOLUME(name, adc_node->nid,
                                         spec->input_mux.items[i].index,
                                         HDA_INPUT);
-               if ((err = snd_ctl_add(codec->bus->card,
-                                      snd_ctl_new1(&knew, codec))) < 0)
+               err = snd_hda_ctl_add(codec, snd_ctl_new1(&knew, codec));
+               if (err < 0)
                        return err;
        }
 
@@ -1096,3 +1101,4 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)
        snd_hda_generic_free(codec);
        return err;
 }
+EXPORT_SYMBOL(snd_hda_parse_generic_codec);