Commit 9de7eadd authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mark Brown

ASoC: SOF: disallow building without CONFIG_PCI again

Compile-testing without PCI just causes warnings:

sound/soc/sof/sof-pci-dev.c:330:13: error: 'sof_pci_remove' defined but not used [-Werror=unused-function]
 static void sof_pci_remove(struct pci_dev *pci)
             ^~~~~~~~~~~~~~
sound/soc/sof/sof-pci-dev.c:230:12: error: 'sof_pci_probe' defined but not used [-Werror=unused-function]
 static int sof_pci_probe(struct pci_dev *pci,
            ^~~~~~~~~~~~~

I tried to fix this in a way that would still allow compile
tests, but it got too ugly, so this just reverts the patch
that allowed it in the first place.

Most architectures do allow enabling PCI, so the value of the
COMPILE_TEST alternative was not very high to start with.

Fixes: e13ef82a ("ASoC: SOF: add COMPILE_TEST for PCI options")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 5b8cc7d1
...@@ -10,7 +10,7 @@ if SND_SOC_SOF_TOPLEVEL ...@@ -10,7 +10,7 @@ if SND_SOC_SOF_TOPLEVEL
config SND_SOC_SOF_PCI config SND_SOC_SOF_PCI
tristate "SOF PCI enumeration support" tristate "SOF PCI enumeration support"
depends on PCI || COMPILE_TEST depends on PCI
select SND_SOC_SOF select SND_SOC_SOF
select SND_SOC_ACPI if ACPI select SND_SOC_ACPI if ACPI
select SND_SOC_SOF_OPTIONS select SND_SOC_SOF_OPTIONS
......
...@@ -525,9 +525,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) ...@@ -525,9 +525,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
* TODO: support interrupt mode selection with kernel parameter * TODO: support interrupt mode selection with kernel parameter
* support msi multiple vectors * support msi multiple vectors
*/ */
#if IS_ENABLED(CONFIG_PCI)
ret = pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_MSI); ret = pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_MSI);
#endif
if (ret < 0) { if (ret < 0) {
dev_info(sdev->dev, "use legacy interrupt mode\n"); dev_info(sdev->dev, "use legacy interrupt mode\n");
/* /*
...@@ -539,9 +537,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) ...@@ -539,9 +537,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
sdev->msi_enabled = 0; sdev->msi_enabled = 0;
} else { } else {
dev_info(sdev->dev, "use msi interrupt mode\n"); dev_info(sdev->dev, "use msi interrupt mode\n");
#if IS_ENABLED(CONFIG_PCI)
hdev->irq = pci_irq_vector(pci, 0); hdev->irq = pci_irq_vector(pci, 0);
#endif
/* ipc irq number is the same of hda irq */ /* ipc irq number is the same of hda irq */
sdev->ipc_irq = hdev->irq; sdev->ipc_irq = hdev->irq;
sdev->msi_enabled = 1; sdev->msi_enabled = 1;
...@@ -598,10 +594,8 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) ...@@ -598,10 +594,8 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
free_hda_irq: free_hda_irq:
free_irq(hdev->irq, bus); free_irq(hdev->irq, bus);
free_irq_vector: free_irq_vector:
#if IS_ENABLED(CONFIG_PCI)
if (sdev->msi_enabled) if (sdev->msi_enabled)
pci_free_irq_vectors(pci); pci_free_irq_vectors(pci);
#endif
free_streams: free_streams:
hda_dsp_stream_free(sdev); hda_dsp_stream_free(sdev);
/* dsp_unmap: not currently used */ /* dsp_unmap: not currently used */
...@@ -616,6 +610,7 @@ int hda_dsp_remove(struct snd_sof_dev *sdev) ...@@ -616,6 +610,7 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
{ {
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
struct hdac_bus *bus = sof_to_bus(sdev); struct hdac_bus *bus = sof_to_bus(sdev);
struct pci_dev *pci = to_pci_dev(sdev->dev);
const struct sof_intel_dsp_desc *chip = hda->desc; const struct sof_intel_dsp_desc *chip = hda->desc;
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
...@@ -644,12 +639,8 @@ int hda_dsp_remove(struct snd_sof_dev *sdev) ...@@ -644,12 +639,8 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
free_irq(sdev->ipc_irq, sdev); free_irq(sdev->ipc_irq, sdev);
free_irq(hda->irq, bus); free_irq(hda->irq, bus);
#if IS_ENABLED(CONFIG_PCI) if (sdev->msi_enabled)
if (sdev->msi_enabled) {
struct pci_dev *pci = to_pci_dev(sdev->dev);
pci_free_irq_vectors(pci); pci_free_irq_vectors(pci);
}
#endif
hda_dsp_stream_free(sdev); hda_dsp_stream_free(sdev);
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) #if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
......
...@@ -251,11 +251,9 @@ static int sof_pci_probe(struct pci_dev *pci, ...@@ -251,11 +251,9 @@ static int sof_pci_probe(struct pci_dev *pci,
if (!sof_pdata) if (!sof_pdata)
return -ENOMEM; return -ENOMEM;
#if IS_ENABLED(CONFIG_PCI)
ret = pcim_enable_device(pci); ret = pcim_enable_device(pci);
if (ret < 0) if (ret < 0)
return ret; return ret;
#endif
ret = pci_request_regions(pci, "Audio DSP"); ret = pci_request_regions(pci, "Audio DSP");
if (ret < 0) if (ret < 0)
...@@ -388,7 +386,6 @@ static const struct pci_device_id sof_pci_ids[] = { ...@@ -388,7 +386,6 @@ static const struct pci_device_id sof_pci_ids[] = {
}; };
MODULE_DEVICE_TABLE(pci, sof_pci_ids); MODULE_DEVICE_TABLE(pci, sof_pci_ids);
#if IS_ENABLED(CONFIG_PCI)
/* pci_driver definition */ /* pci_driver definition */
static struct pci_driver snd_sof_pci_driver = { static struct pci_driver snd_sof_pci_driver = {
.name = "sof-audio-pci", .name = "sof-audio-pci",
...@@ -400,6 +397,5 @@ static struct pci_driver snd_sof_pci_driver = { ...@@ -400,6 +397,5 @@ static struct pci_driver snd_sof_pci_driver = {
}, },
}; };
module_pci_driver(snd_sof_pci_driver); module_pci_driver(snd_sof_pci_driver);
#endif
MODULE_LICENSE("Dual BSD/GPL"); MODULE_LICENSE("Dual BSD/GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment