mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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: Fabien Dessenne <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]> Signed-off-by Alex Elder <[email protected]> Signed-off-by: Bjorn Andersson <[email protected]>
This commit is contained in:
parent
618fcff374
commit
be37b1e0fb
1 changed files with 13 additions and 7 deletions
|
|
@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc)
|
|||
int ret;
|
||||
|
||||
list_for_each_entry(subdev, &rproc->subdevs, node) {
|
||||
ret = subdev->start(subdev);
|
||||
if (ret)
|
||||
goto unroll_registration;
|
||||
if (subdev->start) {
|
||||
ret = subdev->start(subdev);
|
||||
if (ret)
|
||||
goto unroll_registration;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
unroll_registration:
|
||||
list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node)
|
||||
subdev->stop(subdev, true);
|
||||
list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) {
|
||||
if (subdev->stop)
|
||||
subdev->stop(subdev, true);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -798,8 +802,10 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed)
|
|||
{
|
||||
struct rproc_subdev *subdev;
|
||||
|
||||
list_for_each_entry_reverse(subdev, &rproc->subdevs, node)
|
||||
subdev->stop(subdev, crashed);
|
||||
list_for_each_entry_reverse(subdev, &rproc->subdevs, node) {
|
||||
if (subdev->stop)
|
||||
subdev->stop(subdev, crashed);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue