diff options
| author | Ben Levinsky <ben.levinsky@amd.com> | 2026-05-28 19:16:36 -0700 |
|---|---|---|
| committer | Mathieu Poirier <mathieu.poirier@linaro.org> | 2026-06-29 09:32:43 -0600 |
| commit | e6b4e660f08894ef8fa2aaee3ef5c0f86ae4c59d (patch) | |
| tree | e9771c600a6fff5a7c95bd3c97eb096a2e3a96ad | |
| parent | 0db071a39c8637262a00763adfc44c2fae89c82c (diff) | |
| download | linux-next-e6b4e660f08894ef8fa2aaee3ef5c0f86ae4c59d.tar.gz linux-next-e6b4e660f08894ef8fa2aaee3ef5c0f86ae4c59d.zip | |
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>
| -rw-r--r-- | drivers/remoteproc/remoteproc_internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index 9afda697271d..02c00475b010 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h @@ -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) |
