Skip to contentSkip to conversation

ALSA: hda/ca0132 - make pci_iounmap() call conditional

PATCH In review Arnd Bergmann 2 participants 2 messages Dec 10, 2018 – Dec 11, 2018 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda/ca0132 - make pci_iounmap() call conditional

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.

---
 sound/pci/hda/patch_ca0132.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_ca0132.c +1 -1
index c40cb6336017..e5bdbc245682 100644
@@ -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);
Signature · 1 line
2.20.0
#1 lore raw
Quoted 10 lines · Arnd Bergmann

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.

The proper "fix" would be to make this working for SH no matter which config is... But pci_iomap and pci_iounmap() are such a mess, and no one really cares about SH nowadays, so I'd take this easier way.

thanks,

Takashi

Quoted 21 lines
---
 sound/pci/hda/patch_ca0132.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/patch_ca0132.c +1 -1
index c40cb6336017..e5bdbc245682 100644
@@ -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);
Signature · 1 line
2.20.0