linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: hda/ca0132 - make pci_iounmap() call conditional
@ 2018-12-10 20:54 Arnd Bergmann
  2018-12-11  8:14 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:54 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Connor McAdams, Takashi Sakamoto
  Cc: Arnd Bergmann, Alastair Bridgewater, alsa-devel, linux-kernel

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/pci/hda/patch_ca0132.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
index c40cb6336017..e5bdbc245682 100644
--- a/sound/pci/hda/patch_ca0132.c
+++ b/sound/pci/hda/patch_ca0132.c
@@ -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);
-- 
2.20.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ALSA: hda/ca0132 - make pci_iounmap() call conditional
  2018-12-10 20:54 [PATCH] ALSA: hda/ca0132 - make pci_iounmap() call conditional Arnd Bergmann
@ 2018-12-11  8:14 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2018-12-11  8:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Connor McAdams, Jaroslav Kysela, Takashi Sakamoto, alsa-devel,
	Alastair Bridgewater, linux-kernel

On Mon, 10 Dec 2018 21:54:25 +0100,
Arnd Bergmann wrote:
> 
> 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.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

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

> ---
>  sound/pci/hda/patch_ca0132.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c
> index c40cb6336017..e5bdbc245682 100644
> --- a/sound/pci/hda/patch_ca0132.c
> +++ b/sound/pci/hda/patch_ca0132.c
> @@ -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);
> -- 
> 2.20.0
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-11  8:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 20:54 [PATCH] ALSA: hda/ca0132 - make pci_iounmap() call conditional Arnd Bergmann
2018-12-11  8:14 ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).