ALSA: hda/ca0132 - make pci_iounmap() call conditional
authorArnd Bergmann <arnd@arndb.de>
Mon, 10 Dec 2018 20:54:25 +0000 (21:54 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 11 Dec 2018 08:15:39 +0000 (09:15 +0100)
When building without CONFIG_PCI, we can (depending on the architecture)
get a link failure:

ERROR: "pci_iounmap" [sound/pci/hda/snd-hda-codec-ca0132.ko] undefined!

Adding a compile-time check for PCI gets it to work correctly on
32-bit ARM.

Fixes: d99501b8575d ("ALSA: hda/ca0132 - Call pci_iounmap() instead of iounmap()")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/patch_ca0132.c

index c40cb63360174f60a0efb13a137592cc04cdc910..e5bdbc2456822cb835c9644c7bc69468c91a92c7 100644 (file)
@@ -8451,7 +8451,7 @@ static void ca0132_free(struct hda_codec *codec)
        ca0132_exit_chip(codec);
 
        snd_hda_power_down(codec);
-       if (spec->mem_base)
+       if (IS_ENABLED(CONFIG_PCI) && spec->mem_base)
                pci_iounmap(codec->bus->pci, spec->mem_base);
        kfree(spec->spec_init_verbs);
        kfree(codec->spec);