ALSA: hda - Don't refer ELD when unplugged
authorTakashi Iwai <tiwai@suse.de>
Tue, 11 Jan 2011 17:07:14 +0000 (18:07 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 23:14:04 +0000 (15:14 -0800)
commit 6661702f2e803b55b50cc0471eb6b9254e99eef2 upstream.

When unplugged, we shouldn't refer to ELD information for PCM open
any more.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/pci/hda/patch_hdmi.c

index 31df774..02b7ef6 100644 (file)
@@ -827,7 +827,7 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo,
                *codec_pars = *hinfo;
 
        eld = &spec->sink_eld[idx];
-       if (eld->sad_count > 0) {
+       if (eld->eld_valid && eld->sad_count > 0) {
                hdmi_eld_update_pcm_info(eld, hinfo, codec_pars);
                if (hinfo->channels_min > hinfo->channels_max ||
                    !hinfo->rates || !hinfo->formats)