linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: YueHaibing <yuehaibing@huawei.com>
Cc: <lgirdwood@gmail.com>, <broonie@kernel.org>,
	<pierre-louis.bossart@linux.intel.com>,
	<yingjiang.zhu@linux.intel.com>, <perex@perex.cz>,
	<alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error
Date: Fri, 31 May 2019 16:34:17 +0200	[thread overview]
Message-ID: <s5hlfymsnfa.wl-tiwai@suse.de> (raw)
In-Reply-To: <20190531142526.12712-1-yuehaibing@huawei.com>

On Fri, 31 May 2019 16:25:26 +0200,
YueHaibing wrote:
> 
> 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>
> ---
>  sound/soc/sof/intel/hda.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
> index 68db2ac..c1703c4 100644
> --- a/sound/soc/sof/intel/hda.c
> +++ b/sound/soc/sof/intel/hda.c
> @@ -231,7 +231,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;
> @@ -458,7 +460,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;

IMO, this should be better addressed by fixing in linux/pci.h
instead, something like below (totally untested).


thanks,

Takashi

--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -2005,8 +2005,19 @@ static inline void pci_mmcfg_late_init(void) { }
 
 int pci_ext_cfg_avail(void);
 
+#ifdef CONFIG_PCI
 void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar);
 void __iomem *pci_ioremap_wc_bar(struct pci_dev *pdev, int bar);
+#else
+static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar)
+{
+	return NULL;
+}
+static inline void __iomem *pci_ioremap_wc_bar(struct pci_dev *pdev, int bar)
+{
+	return NULL;
+}
+#endif
 
 #ifdef CONFIG_PCI_IOV
 int pci_iov_virtfn_bus(struct pci_dev *dev, int id);

  reply	other threads:[~2019-05-31 14:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 14:25 [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error YueHaibing
2019-05-31 14:34 ` Takashi Iwai [this message]
2019-05-31 18:44   ` [alsa-devel] " Pierre-Louis Bossart
2019-05-31 17:24 ` Pierre-Louis Bossart
2019-06-04 14:58 ` Applied "ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hlfymsnfa.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=yingjiang.zhu@linux.intel.com \
    --cc=yuehaibing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).