ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error
authorYueHaibing <yuehaibing@huawei.com>
Fri, 31 May 2019 14:25:26 +0000 (22:25 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 4 Jun 2019 14:30:22 +0000 (15:30 +0100)
while building without PCI:

sound/soc/sof/intel/hda.o: In function `hda_dsp_probe':
hda.c:(.text+0x79c): undefined reference to `pci_ioremap_bar'
hda.c:(.text+0x79c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `pci_ioremap_bar'
hda.c:(.text+0x7c4): undefined reference to `pci_ioremap_bar'
hda.c:(.text+0x7c4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `pci_ioremap_bar'

Reported-by: Hulk Robot <hulkci@huawei.com>
Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sof/intel/hda.c

index 8f5c68861bbce3242238de0e73dff7261d04c8ea..9e2e0f21524e70f3fe104f4f2547b3dd963a1c5c 100644 (file)
@@ -227,7 +227,9 @@ static int hda_init(struct snd_sof_dev *sdev)
 
        /* initialise hdac bus */
        bus->addr = pci_resource_start(pci, 0);
+#if IS_ENABLED(CONFIG_PCI)
        bus->remap_addr = pci_ioremap_bar(pci, 0);
+#endif
        if (!bus->remap_addr) {
                dev_err(bus->dev, "error: ioremap error\n");
                return -ENXIO;
@@ -454,7 +456,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev)
                goto hdac_bus_unmap;
 
        /* DSP base */
+#if IS_ENABLED(CONFIG_PCI)
        sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR);
+#endif
        if (!sdev->bar[HDA_DSP_BAR]) {
                dev_err(sdev->dev, "error: ioremap error\n");
                ret = -ENXIO;