提交 be37b1e0 编写于 作者: B Bjorn Andersson

remoteproc: Make start and stop in subdev optional

Some subdevices, such as glink ssr only care about the stop operation,
so make the operations optional to reduce client code.
Tested-by: NFabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
上级 618fcff3
...@@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc) ...@@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc)
int ret; int ret;
list_for_each_entry(subdev, &rproc->subdevs, node) { list_for_each_entry(subdev, &rproc->subdevs, node) {
if (subdev->start) {
ret = subdev->start(subdev); ret = subdev->start(subdev);
if (ret) if (ret)
goto unroll_registration; goto unroll_registration;
} }
}
return 0; return 0;
unroll_registration: unroll_registration:
list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) {
if (subdev->stop)
subdev->stop(subdev, true); subdev->stop(subdev, true);
}
return ret; return ret;
} }
...@@ -798,8 +802,10 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed) ...@@ -798,8 +802,10 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed)
{ {
struct rproc_subdev *subdev; struct rproc_subdev *subdev;
list_for_each_entry_reverse(subdev, &rproc->subdevs, node) list_for_each_entry_reverse(subdev, &rproc->subdevs, node) {
if (subdev->stop)
subdev->stop(subdev, crashed); subdev->stop(subdev, crashed);
}
} }
/** /**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册