]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: amd: acp: Fix pointer assignments for snd_soc_acpi_mach structures
authorVenkata Prasad Potturu <venkataprasad.potturu@amd.com>
Mon, 9 Jun 2025 12:12:32 +0000 (17:42 +0530)
committerMark Brown <broonie@kernel.org>
Mon, 9 Jun 2025 12:57:35 +0000 (13:57 +0100)
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>
sound/soc/amd/acp/acp-pci.c
sound/soc/amd/acp/amd-acpi-mach.c
sound/soc/amd/acp/amd.h

index 0b2aa33cc426f921863be2260a85fc197205556a..2591b1a1c5e002007e9f03df16ae512f9d1c07c1 100644 (file)
@@ -137,26 +137,26 @@ static int acp_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id
                chip->name = "acp_asoc_renoir";
                chip->rsrc = &rn_rsrc;
                chip->acp_hw_ops_init = acp31_hw_ops_init;
-               chip->machines = &snd_soc_acpi_amd_acp_machines;
+               chip->machines = snd_soc_acpi_amd_acp_machines;
                break;
        case 0x6f:
                chip->name = "acp_asoc_rembrandt";
                chip->rsrc = &rmb_rsrc;
                chip->acp_hw_ops_init = acp6x_hw_ops_init;
-               chip->machines = &snd_soc_acpi_amd_rmb_acp_machines;
+               chip->machines = snd_soc_acpi_amd_rmb_acp_machines;
                break;
        case 0x63:
                chip->name = "acp_asoc_acp63";
                chip->rsrc = &acp63_rsrc;
                chip->acp_hw_ops_init = acp63_hw_ops_init;
-               chip->machines = &snd_soc_acpi_amd_acp63_acp_machines;
+               chip->machines = snd_soc_acpi_amd_acp63_acp_machines;
                break;
        case 0x70:
        case 0x71:
                chip->name = "acp_asoc_acp70";
                chip->rsrc = &acp70_rsrc;
                chip->acp_hw_ops_init = acp70_hw_ops_init;
-               chip->machines = &snd_soc_acpi_amd_acp70_acp_machines;
+               chip->machines = snd_soc_acpi_amd_acp70_acp_machines;
                break;
        default:
                dev_err(dev, "Unsupported device revision:0x%x\n", pci->revision);
index d95047d2ee945e020dd2908331ca0ef9144b36b5..27da2a862f1c22d702583acd1ef8d3083ce4bb73 100644 (file)
@@ -8,12 +8,12 @@
 
 #include <sound/soc-acpi.h>
 
-struct snd_soc_acpi_codecs amp_rt1019 = {
+static struct snd_soc_acpi_codecs amp_rt1019 = {
        .num_codecs = 1,
        .codecs = {"10EC1019"}
 };
 
-struct snd_soc_acpi_codecs amp_max = {
+static struct snd_soc_acpi_codecs amp_max = {
        .num_codecs = 1,
        .codecs = {"MX98360A"}
 };
index 863e74fcee437eb042ae951d23f2436eabb88dfa..cb8d97122f95c72001eeb047cbf6b066c084ae59 100644 (file)
@@ -243,10 +243,10 @@ extern struct acp_resource rmb_rsrc;
 extern struct acp_resource acp63_rsrc;
 extern struct acp_resource acp70_rsrc;
 
-extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines;
-extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_acp_machines;
-extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_acp_machines;
-extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_acp_machines;
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp_machines[];
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_rmb_acp_machines[];
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp63_acp_machines[];
+extern struct snd_soc_acpi_mach snd_soc_acpi_amd_acp70_acp_machines[];
 
 extern const struct snd_soc_dai_ops asoc_acp_cpu_dai_ops;
 extern const struct snd_soc_dai_ops acp_dmic_dai_ops;