Skip to content

Commit 2a6794a

Browse files
ujfalusitiwai
authored andcommitted
ALSA: hda: intel-nhlt: Print errors in intel_nhlt_ssp_device_type()
Do not fail silently when the intel_nhlt_ssp_device_type() fails as it can be for two reasons: The NHLT table is missing or the SSP instance is missing from the table. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Link: https://patch.msgid.link/20250508181446.25323-1-peter.ujfalusi@linux.intel.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 7f3ef3a commit 2a6794a

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

sound/hda/intel-nhlt.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,11 @@ int intel_nhlt_ssp_device_type(struct device *dev, struct nhlt_acpi_table *nhlt,
350350
struct nhlt_endpoint *epnt;
351351
int i;
352352

353-
if (!nhlt)
353+
if (!nhlt) {
354+
dev_err(dev, "%s: NHLT table is missing (query for SSP%d)\n",
355+
__func__, virtual_bus_id);
354356
return -EINVAL;
357+
}
355358

356359
epnt = (struct nhlt_endpoint *)nhlt->desc;
357360
for (i = 0; i < nhlt->endpoint_count; i++) {
@@ -366,6 +369,20 @@ int intel_nhlt_ssp_device_type(struct device *dev, struct nhlt_acpi_table *nhlt,
366369
epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length);
367370
}
368371

372+
dev_err(dev, "%s: No match for SSP%d in NHLT table\n", __func__,
373+
virtual_bus_id);
374+
375+
dev_dbg(dev, "Available endpoints:\n");
376+
epnt = (struct nhlt_endpoint *)nhlt->desc;
377+
for (i = 0; i < nhlt->endpoint_count; i++) {
378+
dev_dbg(dev,
379+
"%d: link_type: %d, vbus_id: %d, dir: %d, dev_type: %d\n",
380+
i, epnt->linktype, epnt->virtual_bus_id,
381+
epnt->direction, epnt->device_type);
382+
383+
epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length);
384+
}
385+
369386
return -EINVAL;
370387
}
371388
EXPORT_SYMBOL(intel_nhlt_ssp_device_type);

0 commit comments

Comments
 (0)