[PATCH 01/19] remoteproc: add a rproc_get_elf_ops interface

From: Peter Griffin
Date: Wed May 25 2016 - 04:54:02 EST


This allows us to re-use some of the generic fw_ops such
as rproc_elf_sanity_check() and rproc_elf_load_segments() whilst
overriding some of the others with our own implementation.

Signed-off-by: Peter Griffin <peter.griffin@xxxxxxxxxx>
---
drivers/remoteproc/remoteproc_elf_loader.c | 6 ++++++
include/linux/remoteproc.h | 2 ++
2 files changed, 8 insertions(+)

diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c
index ce283a5..a3e06df 100644
--- a/drivers/remoteproc/remoteproc_elf_loader.c
+++ b/drivers/remoteproc/remoteproc_elf_loader.c
@@ -335,3 +335,9 @@ const struct rproc_fw_ops rproc_elf_fw_ops = {
.sanity_check = rproc_elf_sanity_check,
.get_boot_addr = rproc_elf_get_boot_addr
};
+
+const struct rproc_fw_ops *rproc_get_elf_ops(void)
+{
+ return &rproc_elf_fw_ops;
+}
+EXPORT_SYMBOL_GPL(rproc_get_elf_ops);
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h
index 9c4e138..b0b06c8 100644
--- a/include/linux/remoteproc.h
+++ b/include/linux/remoteproc.h
@@ -495,6 +495,8 @@ int rproc_boot(struct rproc *rproc);
void rproc_shutdown(struct rproc *rproc);
void rproc_report_crash(struct rproc *rproc, enum rproc_crash_type type);

+const struct rproc_fw_ops *rproc_get_elf_ops(void);
+
static inline struct rproc_vdev *vdev_to_rvdev(struct virtio_device *vdev)
{
return container_of(vdev, struct rproc_vdev, vdev);
--
1.9.1