mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
remoteproc: guard wc-ioremap helpers with HAS_IOMEM
The common wc-ioremap carveout callbacks live in
remoteproc_internal.h, which is included by the remoteproc core.
This means the helper bodies are parsed even for builds that do not
enable any platform driver using those callbacks.
On s390, CONFIG_HAS_IOMEM and CONFIG_GENERIC_IOREMAP depend on
CONFIG_PCI. A randconfig with CONFIG_REMOTEPROC=y and CONFIG_PCI=n
therefore has no usable ioremap_wc() or iounmap() declarations, and
fails to build the common remoteproc objects with implicit declarations
from the helper bodies.
Only include linux/io.h and build the real wc-ioremap helpers when
CONFIG_HAS_IOMEM is enabled. Provide no-IOMEM stubs so the internal
header remains self-contained for randconfig and COMPILE_TEST coverage.
Fixes: 50227acbf4 ("remoteproc: Add common wc-ioremap carveout callbacks")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202606301559.w8eorNQ2-lkp@intel.com/
Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Link: https://lore.kernel.org/r/20260630174056.667646-1-ben.levinsky@amd.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
committed by
Mathieu Poirier
parent
70cfc11cfc
commit
5254315483
@@ -14,7 +14,9 @@
|
||||
|
||||
#include <linux/irqreturn.h>
|
||||
#include <linux/firmware.h>
|
||||
#ifdef CONFIG_HAS_IOMEM
|
||||
#include <linux/io.h>
|
||||
#endif
|
||||
|
||||
struct rproc;
|
||||
|
||||
@@ -123,6 +125,7 @@ rproc_find_carveout_by_name(struct rproc *rproc, const char *name, ...);
|
||||
void rproc_add_rvdev(struct rproc *rproc, struct rproc_vdev *rvdev);
|
||||
void rproc_remove_rvdev(struct rproc_vdev *rvdev);
|
||||
|
||||
#ifdef CONFIG_HAS_IOMEM
|
||||
static inline int rproc_mem_entry_ioremap_wc(struct rproc *rproc,
|
||||
struct rproc_mem_entry *mem)
|
||||
{
|
||||
@@ -148,6 +151,19 @@ static inline int rproc_mem_entry_iounmap(struct rproc *rproc,
|
||||
|
||||
return 0;
|
||||
}
|
||||
#else
|
||||
static inline int rproc_mem_entry_ioremap_wc(struct rproc *rproc,
|
||||
struct rproc_mem_entry *mem)
|
||||
{
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
static inline int rproc_mem_entry_iounmap(struct rproc *rproc,
|
||||
struct rproc_mem_entry *mem)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define rproc_elf_load_rsc_table_optional(rproc, fw, dev_func, fmt, ...) \
|
||||
({ \
|
||||
|
||||
Reference in New Issue
Block a user