remoteproc: Add helper for optional ELF resource tables

Add a helper macro around rproc_elf_load_rsc_table() for thin parse_fw()
wrappers that treat a missing ELF resource table as optional while
keeping per-driver logging decisions local to the caller of
rproc_elf_load_rsc_table_optional().

Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
Tested-by: Peng Fan <peng.fan@nxp.com> #i.MX8MP-EVK
Link: https://lore.kernel.org/r/20260529021637.2077602-5-ben.levinsky@amd.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
This commit is contained in:
Ben Levinsky 2026-05-28 19:16:36 -07:00 committed by Mathieu Poirier
parent 0db071a39c
commit e6b4e660f0

View File

@ -149,6 +149,17 @@ static inline int rproc_mem_entry_iounmap(struct rproc *rproc,
return 0;
}
#define rproc_elf_load_rsc_table_optional(rproc, fw, dev_func, fmt, ...) \
({ \
int ret = rproc_elf_load_rsc_table(rproc, fw); \
if (ret == -EINVAL) { \
dev_func(&rproc->dev, fmt, ##__VA_ARGS__); \
return 0; \
} else { \
return ret; \
} \
})
static inline int rproc_prepare_device(struct rproc *rproc)
{
if (rproc->ops->prepare)