diff mbox series

remoteproc: Stop subdevices in reverse order

Message ID 20170828053142.26152-1-bjorn.andersson@linaro.org
State Accepted
Commit f9cbbd256ccebc5911cb163f1cbb59fefd173d9a
Headers show
Series remoteproc: Stop subdevices in reverse order | expand

Commit Message

Bjorn Andersson Aug. 28, 2017, 5:31 a.m. UTC
Subdevices might depend on earlier registered subdevices for
communication purposes, as such they should be stopped in reverse order
so that said communication channel is removed after the dependent
subdevice is stopped.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

---
 drivers/remoteproc/remoteproc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.12.0
diff mbox series

Patch

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index e82f60182027..5aaa4c21d14d 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -794,7 +794,7 @@  static void rproc_remove_subdevices(struct rproc *rproc)
 {
 	struct rproc_subdev *subdev;
 
-	list_for_each_entry(subdev, &rproc->subdevs, node)
+	list_for_each_entry_reverse(subdev, &rproc->subdevs, node)
 		subdev->remove(subdev);
 }