ASoC: SOF: add COMPILE_TEST for PCI options

Add COMPILE_TEST and use IS_ENABLED(CONFIG_PCI) to sort out
cross-compilation issues.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Pierre-Louis Bossart
2019-05-30 06:50:15 -05:00
committed by Mark Brown
parent 8fe751d8fd
commit e13ef82a9a
3 changed files with 16 additions and 3 deletions

View File

@@ -251,9 +251,11 @@ static int sof_pci_probe(struct pci_dev *pci,
if (!sof_pdata)
return -ENOMEM;
#if IS_ENABLED(CONFIG_PCI)
ret = pcim_enable_device(pci);
if (ret < 0)
return ret;
#endif
ret = pci_request_regions(pci, "Audio DSP");
if (ret < 0)
@@ -386,6 +388,7 @@ static const struct pci_device_id sof_pci_ids[] = {
};
MODULE_DEVICE_TABLE(pci, sof_pci_ids);
#if IS_ENABLED(CONFIG_PCI)
/* pci_driver definition */
static struct pci_driver snd_sof_pci_driver = {
.name = "sof-audio-pci",
@@ -397,5 +400,6 @@ static struct pci_driver snd_sof_pci_driver = {
},
};
module_pci_driver(snd_sof_pci_driver);
#endif
MODULE_LICENSE("Dual BSD/GPL");