aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/hda_intel.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 5e478b917aab..d40951527f66 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -979,7 +979,7 @@ static unsigned int azx_max_codecs[] __devinitdata = {
979static int __devinit azx_codec_create(struct azx *chip, const char *model) 979static int __devinit azx_codec_create(struct azx *chip, const char *model)
980{ 980{
981 struct hda_bus_template bus_temp; 981 struct hda_bus_template bus_temp;
982 int c, codecs, err; 982 int c, codecs, audio_codecs, err;
983 983
984 memset(&bus_temp, 0, sizeof(bus_temp)); 984 memset(&bus_temp, 0, sizeof(bus_temp));
985 bus_temp.private_data = chip; 985 bus_temp.private_data = chip;
@@ -991,16 +991,19 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model)
991 if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0) 991 if ((err = snd_hda_bus_new(chip->card, &bus_temp, &chip->bus)) < 0)
992 return err; 992 return err;
993 993
994 codecs = 0; 994 codecs = audio_codecs = 0;
995 for (c = 0; c < AZX_MAX_CODECS; c++) { 995 for (c = 0; c < AZX_MAX_CODECS; c++) {
996 if ((chip->codec_mask & (1 << c)) & probe_mask) { 996 if ((chip->codec_mask & (1 << c)) & probe_mask) {
997 err = snd_hda_codec_new(chip->bus, c, NULL); 997 struct hda_codec *codec;
998 err = snd_hda_codec_new(chip->bus, c, &codec);
998 if (err < 0) 999 if (err < 0)
999 continue; 1000 continue;
1000 codecs++; 1001 codecs++;
1002 if (codec->afg)
1003 audio_codecs++;
1001 } 1004 }
1002 } 1005 }
1003 if (!codecs) { 1006 if (!audio_codecs) {
1004 /* probe additional slots if no codec is found */ 1007 /* probe additional slots if no codec is found */
1005 for (; c < azx_max_codecs[chip->driver_type]; c++) { 1008 for (; c < azx_max_codecs[chip->driver_type]; c++) {
1006 if ((chip->codec_mask & (1 << c)) & probe_mask) { 1009 if ((chip->codec_mask & (1 << c)) & probe_mask) {