summaryrefslogtreecommitdiffstats
path: root/drivers/remoteproc
diff options
context:
space:
mode:
authorClement Leger <cleger@kalray.eu>2020-03-02 10:39:01 +0100
committerBjorn Andersson <bjorn.andersson@linaro.org>2020-03-25 22:29:41 -0700
commit12677467d6d5897391ef635db97787aef2f574eb (patch)
tree23cb2ca7fce452c6161b5a4b5ddc5411c2ecc2e9 /drivers/remoteproc
parentf31e339f1b9b765c8c727d635c1b74424c102c1e (diff)
downloadlinux-12677467d6d5897391ef635db97787aef2f574eb.tar.gz
linux-12677467d6d5897391ef635db97787aef2f574eb.tar.bz2
linux-12677467d6d5897391ef635db97787aef2f574eb.zip
remoteproc: Allow overriding only sanity_check
Now that rproc_elf_sanity_check can be used by external drivers, allow to only overwrite the sanity_check member of rproc_ops. This will allow drivers to handle elf32 and elf64 by overwriting sanity_check with rproc_elf_sanity_check function. Signed-off-by: Clement Leger <cleger@kalray.eu> Link: https://lore.kernel.org/r/20200302093902.27849-8-cleger@kalray.eu Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r--drivers/remoteproc/remoteproc_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 0f4a426447ae..aa598f99791a 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -2061,7 +2061,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name,
rproc->ops->load = rproc_elf_load_segments;
rproc->ops->parse_fw = rproc_elf_load_rsc_table;
rproc->ops->find_loaded_rsc_table = rproc_elf_find_loaded_rsc_table;
- rproc->ops->sanity_check = rproc_elf32_sanity_check;
+ if (!rproc->ops->sanity_check)
+ rproc->ops->sanity_check = rproc_elf32_sanity_check;
rproc->ops->get_boot_addr = rproc_elf_get_boot_addr;
}