diff options
author | Bjorn Andersson <bjorn.andersson@linaro.org> | 2018-06-26 08:11:56 -0400 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2018-06-26 16:53:06 -0400 |
commit | be37b1e0fb100a369cfb7ebf016491dfb6c71987 (patch) | |
tree | 360bbd42f51cba5e7b472745b975d48e838f4002 | |
parent | 618fcff3742b4c62fea24bea1f01a2f002ed4b37 (diff) |
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 <fabien.dessenne@st.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
-rw-r--r-- | drivers/remoteproc/remoteproc_core.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 5dd58e6bea88..981ae6dff145 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
@@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc) | |||
780 | int ret; | 780 | int ret; |
781 | 781 | ||
782 | list_for_each_entry(subdev, &rproc->subdevs, node) { | 782 | list_for_each_entry(subdev, &rproc->subdevs, node) { |
783 | ret = subdev->start(subdev); | 783 | if (subdev->start) { |
784 | if (ret) | 784 | ret = subdev->start(subdev); |
785 | goto unroll_registration; | 785 | if (ret) |
786 | goto unroll_registration; | ||
787 | } | ||
786 | } | 788 | } |
787 | 789 | ||
788 | return 0; | 790 | return 0; |
789 | 791 | ||
790 | unroll_registration: | 792 | unroll_registration: |
791 | list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) | 793 | list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) { |
792 | subdev->stop(subdev, true); | 794 | if (subdev->stop) |
795 | subdev->stop(subdev, true); | ||
796 | } | ||
793 | 797 | ||
794 | return ret; | 798 | return ret; |
795 | } | 799 | } |
@@ -798,8 +802,10 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed) | |||
798 | { | 802 | { |
799 | struct rproc_subdev *subdev; | 803 | struct rproc_subdev *subdev; |
800 | 804 | ||
801 | list_for_each_entry_reverse(subdev, &rproc->subdevs, node) | 805 | list_for_each_entry_reverse(subdev, &rproc->subdevs, node) { |
802 | subdev->stop(subdev, crashed); | 806 | if (subdev->stop) |
807 | subdev->stop(subdev, crashed); | ||
808 | } | ||
803 | } | 809 | } |
804 | 810 | ||
805 | /** | 811 | /** |