[RFCv2 10/11] remoteproc: Find resource table in device memory

Sjur Brændeland
2012-12-14T16:08:24Z

Call rproc_get_rsctab_addr() to get the address
of the resource table in shared memory.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
---
drivers/remoteproc/remoteproc_core.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8a7de5c..f95c08c 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -854,6 +854,13 @@ static void rproc_fw_load(const struct firmware *fw, void *context)
goto clean_up;
}

+ /* Find the new location of the resource table in device memory */
+ table = rproc_get_rsctab_addr(rproc, fw);
+ if (!table) {
+ ret = -EINVAL;
+ goto clean_up;
+ }
+
ret = rproc_handle_resource(rproc, table, tablesz, rproc_handle_reg);
if (ret) {
dev_err(dev, "Failed to process resources: %d\n", ret);
--
1.7.5.4