@@ -1330,7 +1330,7 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw)
}
/* power up the remote processor */
- ret = rproc->ops->start(rproc);
+ ret = rproc_start_hw(rproc);
if (ret) {
dev_err(dev, "can't start rproc %s: %d\n", rproc->name, ret);
goto unprepare_subdevices;
@@ -1351,7 +1351,7 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw)
return 0;
stop_rproc:
- rproc->ops->stop(rproc);
+ rproc_stop_hw(rproc);
unprepare_subdevices:
rproc_unprepare_subdevices(rproc);
reset_table_ptr:
@@ -1483,7 +1483,7 @@ static int rproc_stop(struct rproc *rproc, bool crashed)
rproc->table_ptr = rproc->cached_table;
/* power off the remote processor */
- ret = rproc->ops->stop(rproc);
+ ret = rproc_stop_hw(rproc);
if (ret) {
dev_err(dev, "can't stop rproc: %d\n", ret);
return ret;
@@ -159,4 +159,16 @@ struct resource_table *rproc_find_loaded_rsc_table(struct rproc *rproc,
return NULL;
}
+static inline int rproc_start_hw(struct rproc *rproc)
+{
+ RPROC_OPS_HELPER(start, rproc);
+ return -EINVAL;
+}
+
+static inline int rproc_stop_hw(struct rproc *rproc)
+{
+ RPROC_OPS_HELPER(stop, rproc);
+ return -EINVAL;
+}
+
#endif /* REMOTEPROC_INTERNAL_H */
Add new functions to replace direct calling of rproc->ops->start() and rproc->ops->stop(). That way different behaviour can be played out when booting an MCU or synchronising with it. Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> --- drivers/remoteproc/remoteproc_core.c | 6 +++--- drivers/remoteproc/remoteproc_internal.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-)