Skip to content

Commit 8a3fea9

Browse files
plbossartbroonie
authored andcommitted
ASoC: SOF: SND_INTEL_DSP_CONFIG dependency
The sof-pci-dev driver fails to link when built into the kernel and CONFIG_SND_INTEL_DSP_CONFIG is set to =m: arm-linux-gnueabi-ld: sound/soc/sof/sof-pci-dev.o: in function `sof_pci_probe': sof-pci-dev.c:(.text+0x1c): undefined reference to `snd_intel_dsp_driver_probe' As a temporary fix, use IS_REACHABLE to prevent the problem from happening. A more complete solution is to move this code to Intel-specific parts, restructure the drivers and Kconfig as discussed with Arnd Bergmann and Takashi Iwai. Fixes: 82d9d54 ("ALSA: hda: add Intel DSP configuration / probe code") Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Pierre-Louis Bossart <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent bd9038f commit 8a3fea9

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

sound/soc/sof/sof-acpi-dev.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,13 @@ static int sof_acpi_probe(struct platform_device *pdev)
131131
if (!id)
132132
return -ENODEV;
133133

134-
ret = snd_intel_acpi_dsp_driver_probe(dev, id->id);
135-
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
136-
dev_dbg(dev, "SOF ACPI driver not selected, aborting probe\n");
137-
return -ENODEV;
134+
if (IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)) {
135+
ret = snd_intel_acpi_dsp_driver_probe(dev, id->id);
136+
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
137+
dev_dbg(dev, "SOF ACPI driver not selected, aborting probe\n");
138+
return -ENODEV;
139+
}
138140
}
139-
140141
dev_dbg(dev, "ACPI DSP detected");
141142

142143
sof_pdata = devm_kzalloc(dev, sizeof(*sof_pdata), GFP_KERNEL);

sound/soc/sof/sof-pci-dev.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,12 @@ static int sof_pci_probe(struct pci_dev *pci,
344344
const struct snd_sof_dsp_ops *ops;
345345
int ret;
346346

347-
ret = snd_intel_dsp_driver_probe(pci);
348-
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
349-
dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
350-
return -ENODEV;
347+
if (IS_REACHABLE(CONFIG_SND_INTEL_DSP_CONFIG)) {
348+
ret = snd_intel_dsp_driver_probe(pci);
349+
if (ret != SND_INTEL_DSP_DRIVER_ANY && ret != SND_INTEL_DSP_DRIVER_SOF) {
350+
dev_dbg(&pci->dev, "SOF PCI driver not selected, aborting probe\n");
351+
return -ENODEV;
352+
}
351353
}
352354
dev_dbg(&pci->dev, "PCI DSP detected");
353355

0 commit comments

Comments
 (0)