Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Peter Ujfalusi and committed by
Takashi Iwai
2a6794a9 7f3ef3ab

+18 -1
+18 -1
sound/hda/intel-nhlt.c
··· 350 350 struct nhlt_endpoint *epnt; 351 351 int i; 352 352 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); 354 356 return -EINVAL; 357 + } 355 358 356 359 epnt = (struct nhlt_endpoint *)nhlt->desc; 357 360 for (i = 0; i < nhlt->endpoint_count; i++) { ··· 365 362 epnt->device_type); 366 363 return epnt->device_type; 367 364 } 365 + 366 + epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length); 367 + } 368 + 369 + dev_err(dev, "%s: No match for SSP%d in NHLT table\n", __func__, 370 + virtual_bus_id); 371 + 372 + dev_dbg(dev, "Available endpoints:\n"); 373 + epnt = (struct nhlt_endpoint *)nhlt->desc; 374 + for (i = 0; i < nhlt->endpoint_count; i++) { 375 + dev_dbg(dev, 376 + "%d: link_type: %d, vbus_id: %d, dir: %d, dev_type: %d\n", 377 + i, epnt->linktype, epnt->virtual_bus_id, 378 + epnt->direction, epnt->device_type); 368 379 369 380 epnt = (struct nhlt_endpoint *)((u8 *)epnt + epnt->length); 370 381 }