ALSA: hda - hdmi_find_pcm_slot return value bug fix
authorLibin Yang <libin.yang@linux.intel.com>
Tue, 1 Mar 2016 07:18:26 +0000 (15:18 +0800)
committerTakashi Iwai <tiwai@suse.de>
Tue, 1 Mar 2016 09:29:21 +0000 (10:29 +0100)
hdmi_find_pcm_slot return -EBUSY when not no pcm slot found,
not -ENODEV. So the caller should compare with -EBUSY.

Fixes: a76056f2e57e ('ALSA: hda - hdmi dynamically bind PCM to pin when monitor hotplug')
Signed-off-by: Libin Yang <libin.yang@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_hdmi.c

index 21a2b28..490931d 100644 (file)
@@ -1758,7 +1758,7 @@ static void hdmi_attach_hda_pcm(struct hdmi_spec *spec,
        if (per_pin->pcm)
                return;
        idx = hdmi_find_pcm_slot(spec, per_pin);
-       if (idx == -ENODEV)
+       if (idx == -EBUSY)
                return;
        per_pin->pcm_idx = idx;
        per_pin->pcm = get_hdmi_pcm(spec, idx);