Commit 3eaead57 authored by Wu Fengguang's avatar Wu Fengguang Committed by Takashi Iwai

ALSA: hdmi - dont fail on extra nodes

The number of HDMI nodes is expected to go up in future.
So don't fail hard on seeing extra converter/pin nodes.

We can still operate safely on the nodes within
MAX_HDMI_CVTS/MAX_HDMI_PINS.
Signed-off-by: default avatarWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent e48b0087
...@@ -766,7 +766,7 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid) ...@@ -766,7 +766,7 @@ static int hdmi_add_pin(struct hda_codec *codec, hda_nid_t pin_nid)
if (spec->num_pins >= MAX_HDMI_PINS) { if (spec->num_pins >= MAX_HDMI_PINS) {
snd_printk(KERN_WARNING snd_printk(KERN_WARNING
"HDMI: no space for pin %d\n", pin_nid); "HDMI: no space for pin %d\n", pin_nid);
return -EINVAL; return -E2BIG;
} }
hdmi_present_sense(codec, pin_nid, &spec->sink_eld[spec->num_pins]); hdmi_present_sense(codec, pin_nid, &spec->sink_eld[spec->num_pins]);
...@@ -788,7 +788,7 @@ static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t nid) ...@@ -788,7 +788,7 @@ static int hdmi_add_cvt(struct hda_codec *codec, hda_nid_t nid)
if (spec->num_cvts >= MAX_HDMI_CVTS) { if (spec->num_cvts >= MAX_HDMI_CVTS) {
snd_printk(KERN_WARNING snd_printk(KERN_WARNING
"HDMI: no space for converter %d\n", nid); "HDMI: no space for converter %d\n", nid);
return -EINVAL; return -E2BIG;
} }
spec->cvt[spec->num_cvts] = nid; spec->cvt[spec->num_cvts] = nid;
...@@ -820,15 +820,13 @@ static int hdmi_parse_codec(struct hda_codec *codec) ...@@ -820,15 +820,13 @@ static int hdmi_parse_codec(struct hda_codec *codec)
switch (type) { switch (type) {
case AC_WID_AUD_OUT: case AC_WID_AUD_OUT:
if (hdmi_add_cvt(codec, nid) < 0) hdmi_add_cvt(codec, nid);
return -EINVAL;
break; break;
case AC_WID_PIN: case AC_WID_PIN:
caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP); caps = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP))) if (!(caps & (AC_PINCAP_HDMI | AC_PINCAP_DP)))
continue; continue;
if (hdmi_add_pin(codec, nid) < 0) hdmi_add_pin(codec, nid);
return -EINVAL;
break; break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment