]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ALSA: hda - Don't create empty PCM streams
authorTakashi Iwai <tiwai@suse.de>
Tue, 4 Nov 2008 16:48:39 +0000 (17:48 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 4 Nov 2008 16:48:39 +0000 (17:48 +0100)
Due to the hda-reconfiguration patches, the check of empty stream
is gone, and this results in an error with the codec setup with empty
streams.

This patch adds the check again to avoid the error at probing.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.c

index aa9cd142c30a62e22f1cb9481d890e6e714fb395..3e7cda9c3de5ef2ef7c7b2c83fcb2e7b5504bc8b 100644 (file)
@@ -2485,6 +2485,11 @@ int snd_hda_build_pcms(struct hda_bus *bus)
                        struct hda_pcm *cpcm = &codec->pcm_info[pcm];
                        int type = cpcm->pcm_type;
                        int dev;
+
+                       if (!cpcm->stream[0].substreams &&
+                           !cpcm->stream[1].substreams)
+                               continue; /* no substreams assigned */
+
                        switch (type) {
                        case HDA_PCM_TYPE_AUDIO:
                                if (num_devs[type] >= ARRAY_SIZE(audio_idx)) {