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.

ASoC: amd: acp: Fix pointer assignments for snd_soc_acpi_mach structures

This patch modifies the assignment of machine structure pointers in the
acp_pci_probe function. Previously, the machine pointers were assigned
using the address-of operator (&), which caused incompatibility issues
in type assignments.

Additionally, the declarations of the machine arrays in amd.h have been
updated to reflect that they are indeed arrays (`[]`). The code is
further cleaned up by declaring the codec structures in
amd-acpi-mach.c as static, reflecting their intended usage.

error: symbol 'amp_rt1019' was not declared. Should it be static?
error: symbol 'amp_max' was not declared. Should it be static?
error: symbol 'snd_soc_acpi_amd_acp_machines' was not declared. Should it be static?
error: symbol 'snd_soc_acpi_amd_rmb_acp_machines' was not declared. Should it be static?
error: symbol 'snd_soc_acpi_amd_acp63_acp_machines' was not declared. Should it be static?
error: symbol 'snd_soc_acpi_amd_acp70_acp_machines' was not declared. Should it be static?

Fixes: 9c2c0ef64009 ("ASoC: amd: acp: Fix snd_soc_acpi_mach id's duplicate symbol error")

Link: https://github.com/thesofproject/linux/issues/5438
Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Link: https://patch.msgid.link/20250609121251.639080-1-venkataprasad.potturu@amd.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Venkata Prasad Potturu and committed by
Mark Brown
0779c0ad ac209bde

+10 -10
+4 -4
sound/soc/amd/acp/acp-pci.c
··· 137 137 chip->name = "acp_asoc_renoir"; 138 138 chip->rsrc = &rn_rsrc; 139 139 chip->acp_hw_ops_init = acp31_hw_ops_init; 140 - chip->machines = &snd_soc_acpi_amd_acp_machines; 140 + chip->machines = snd_soc_acpi_amd_acp_machines; 141 141 break; 142 142 case 0x6f: 143 143 chip->name = "acp_asoc_rembrandt"; 144 144 chip->rsrc = &rmb_rsrc; 145 145 chip->acp_hw_ops_init = acp6x_hw_ops_init; 146 - chip->machines = &snd_soc_acpi_amd_rmb_acp_machines; 146 + chip->machines = snd_soc_acpi_amd_rmb_acp_machines; 147 147 break; 148 148 case 0x63: 149 149 chip->name = "acp_asoc_acp63"; 150 150 chip->rsrc = &acp63_rsrc; 151 151 chip->acp_hw_ops_init = acp63_hw_ops_init; 152 - chip->machines = &snd_soc_acpi_amd_acp63_acp_machines; 152 + chip->machines = snd_soc_acpi_amd_acp63_acp_machines; 153 153 break; 154 154 case 0x70: 155 155 case 0x71: 156 156 chip->name = "acp_asoc_acp70"; 157 157 chip->rsrc = &acp70_rsrc; 158 158 chip->acp_hw_ops_init = acp70_hw_ops_init; 159 - chip->machines = &snd_soc_acpi_amd_acp70_acp_machines; 159 + chip->machines = snd_soc_acpi_amd_acp70_acp_machines; 160 160 break; 161 161 default: 162 162 dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision);
+2 -2
sound/soc/amd/acp/amd-acpi-mach.c
··· 8 8 9 9 #include <sound/soc-acpi.h> 10 10 11 - struct snd_soc_acpi_codecs amp_rt1019 = { 11 + static struct snd_soc_acpi_codecs amp_rt1019 = { 12 12 .num_codecs = 1, 13 13 .codecs = {"10EC1019"} 14 14 }; 15 15 16 - struct snd_soc_acpi_codecs amp_max = { 16 + static struct snd_soc_acpi_codecs amp_max = { 17 17 .num_codecs = 1, 18 18 .codecs = {"MX98360A"} 19 19 };
+4 -4
sound/soc/amd/acp/amd.h
··· 243 243 extern struct acp_resource acp63_rsrc; 244 244 extern struct acp_resource acp70_rsrc; 245 245 246 - extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines; 247 - extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_acp_machines; 248 - extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_acp_machines; 249 - extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_acp_machines; 246 + extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines[]; 247 + extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_acp_machines[]; 248 + extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_acp_machines[]; 249 + extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_acp_machines[]; 250 250 251 251 extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops; 252 252 extern const struct snd_soc_dai_ops acp_dmic_dai_ops;