Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
@ 2024-12-30  6:49 Baojun Xu
  2024-12-30 10:40 ` Takashi Iwai
  2025-01-13  8:37 ` Andy Shevchenko
  0 siblings, 2 replies; 7+ messages in thread
From: Baojun Xu @ 2024-12-30  6:49 UTC (permalink / raw)
  To: tiwai
  Cc: robh+dt, andriy.shevchenko, lgirdwood, perex, shenghao-ding,
	navada, 13916275206, v-hampiholi, v-po, linux-sound, linux-kernel,
	liam.r.girdwood, yung-chuan.liao, baojun.xu, broonie, antheas.dk,
	stuart.a.hayhurst

Driver will return error if no SUBSYS_ID found in BIOS(acpi).
It will cause error in tas2563 projects, which have no SUBSYS_ID.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
---
 sound/pci/hda/tas2781_hda_i2c.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index 0af015806aba..0e42b87dadb8 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -142,6 +142,9 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
 	}
 	sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
 	if (IS_ERR(sub)) {
+		/* No subsys id in older tas2563 projects. */
+		if (!strncmp(hid, "INT8866", sizeof("INT8866")))
+			goto end_2563;
 		dev_err(p->dev, "Failed to get SUBSYS ID.\n");
 		ret = PTR_ERR(sub);
 		goto err;
@@ -164,6 +167,7 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
 		p->speaker_id = NULL;
 	}
 
+end_2563:
 	acpi_dev_free_resource_list(&resources);
 	strscpy(p->dev_name, hid, sizeof(p->dev_name));
 	put_device(physdev);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects
@ 2025-01-11  9:57 Baojun Xu
  2025-01-12  8:26 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Baojun Xu @ 2025-01-11  9:57 UTC (permalink / raw)
  To: tiwai
  Cc: robh+dt, andriy.shevchenko, lgirdwood, perex, shenghao-ding,
	navada, 13916275206, v-hampiholi, v-po, linux-sound, linux-kernel,
	liam.r.girdwood, yung-chuan.liao, baojun.xu, broonie, antheas.dk,
	stuart.a.hayhurst, dan.carpenter

Driver will return error if no SUBSYS_ID found in BIOS(acpi).
It will cause error in tas2563 projects, which have no SUBSYS_ID.
Change strncmp to strcmp to avoid warning for weird length.

Signed-off-by: Baojun Xu <baojun.xu@ti.com>
---
 sound/pci/hda/tas2781_hda_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index 0e42b87dadb8..61aec92f6536 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -143,7 +143,7 @@ static int tas2781_read_acpi(struct tasdevice_priv *p, const char *hid)
 	sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));
 	if (IS_ERR(sub)) {
 		/* No subsys id in older tas2563 projects. */
-		if (!strncmp(hid, "INT8866", sizeof("INT8866")))
+		if (!strcmp(hid, "INT8866"))
 			goto end_2563;
 		dev_err(p->dev, "Failed to get SUBSYS ID.\n");
 		ret = PTR_ERR(sub);
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-01-13  8:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-30  6:49 [PATCH v1] ALSA: hda/tas2781: Ignore SUBSYS_ID not found for tas2563 projects Baojun Xu
2024-12-30 10:40 ` Takashi Iwai
2025-01-13  8:37 ` Andy Shevchenko
2025-01-13  8:45   ` [EXTERNAL] " Xu, Baojun
  -- strict thread matches above, loose matches on Subject: below --
2025-01-11  9:57 Baojun Xu
2025-01-12  8:26 ` Takashi Iwai
2025-01-13  5:33   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox