remoteproc: Stop subdevices in reverse order
authorBjorn Andersson <bjorn.andersson@linaro.org>
Mon, 28 Aug 2017 05:31:42 +0000 (22:31 -0700)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Wed, 30 Aug 2017 23:29:55 +0000 (16:29 -0700)
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

index 48b2c5ddfb4d9004bce92048d5dad41efbb9823e..8072df1f0f94dd60e2666b1962886f78d6c63905 100644 (file)
@@ -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);
 }