Skip to content

Commit 9de7ead

Browse files
arndbbroonie
authored andcommitted
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: e13ef82 ("ASoC: SOF: add COMPILE_TEST for PCI options") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 5b8cc7d commit 9de7ead

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

‎sound/soc/sof/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if SND_SOC_SOF_TOPLEVEL
1010

1111
config SND_SOC_SOF_PCI
1212
tristate "SOF PCI enumeration support"
13-
depends on PCI || COMPILE_TEST
13+
depends on PCI
1414
select SND_SOC_SOF
1515
select SND_SOC_ACPI if ACPI
1616
select SND_SOC_SOF_OPTIONS

‎sound/soc/sof/intel/hda.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
525525
* TODO: support interrupt mode selection with kernel parameter
526526
* support msi multiple vectors
527527
*/
528-
#if IS_ENABLED(CONFIG_PCI)
529528
ret = pci_alloc_irq_vectors(pci, 1, 1, PCI_IRQ_MSI);
530-
#endif
531529
if (ret < 0) {
532530
dev_info(sdev->dev, "use legacy interrupt mode\n");
533531
/*
@@ -539,9 +537,7 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
539537
sdev->msi_enabled = 0;
540538
} else {
541539
dev_info(sdev->dev, "use msi interrupt mode\n");
542-
#if IS_ENABLED(CONFIG_PCI)
543540
hdev->irq = pci_irq_vector(pci, 0);
544-
#endif
545541
/* ipc irq number is the same of hda irq */
546542
sdev->ipc_irq = hdev->irq;
547543
sdev->msi_enabled = 1;
@@ -598,10 +594,8 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
598594
free_hda_irq:
599595
free_irq(hdev->irq, bus);
600596
free_irq_vector:
601-
#if IS_ENABLED(CONFIG_PCI)
602597
if (sdev->msi_enabled)
603598
pci_free_irq_vectors(pci);
604-
#endif
605599
free_streams:
606600
hda_dsp_stream_free(sdev);
607601
/* dsp_unmap: not currently used */
@@ -616,6 +610,7 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
616610
{
617611
struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;
618612
struct hdac_bus *bus = sof_to_bus(sdev);
613+
struct pci_dev *pci = to_pci_dev(sdev->dev);
619614
const struct sof_intel_dsp_desc *chip = hda->desc;
620615

621616
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
@@ -644,12 +639,8 @@ int hda_dsp_remove(struct snd_sof_dev *sdev)
644639

645640
free_irq(sdev->ipc_irq, sdev);
646641
free_irq(hda->irq, bus);
647-
#if IS_ENABLED(CONFIG_PCI)
648-
if (sdev->msi_enabled) {
649-
struct pci_dev *pci = to_pci_dev(sdev->dev);
642+
if (sdev->msi_enabled)
650643
pci_free_irq_vectors(pci);
651-
}
652-
#endif
653644

654645
hda_dsp_stream_free(sdev);
655646
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,9 @@ static int sof_pci_probe(struct pci_dev *pci,
251251
if (!sof_pdata)
252252
return -ENOMEM;
253253

254-
#if IS_ENABLED(CONFIG_PCI)
255254
ret = pcim_enable_device(pci);
256255
if (ret < 0)
257256
return ret;
258-
#endif
259257

260258
ret = pci_request_regions(pci, "Audio DSP");
261259
if (ret < 0)
@@ -388,7 +386,6 @@ static const struct pci_device_id sof_pci_ids[] = {
388386
};
389387
MODULE_DEVICE_TABLE(pci, sof_pci_ids);
390388

391-
#if IS_ENABLED(CONFIG_PCI)
392389
/* pci_driver definition */
393390
static struct pci_driver snd_sof_pci_driver = {
394391
.name = "sof-audio-pci",
@@ -400,6 +397,5 @@ static struct pci_driver snd_sof_pci_driver = {
400397
},
401398
};
402399
module_pci_driver(snd_sof_pci_driver);
403-
#endif
404400

405401
MODULE_LICENSE("Dual BSD/GPL");

0 commit comments

Comments
 (0)