Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit be37b1e0 authored by Bjorn Andersson's avatar Bjorn Andersson
Browse files

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: default avatarFabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 618fcff3
Loading
Loading
Loading
Loading
+13 −7
Original line number Diff line number Diff line
@@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc)
	int ret;

	list_for_each_entry(subdev, &rproc->subdevs, node) {
		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)
	list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) {
		if (subdev->stop)
			subdev->stop(subdev, true);
	}

	return ret;
}
@@ -798,9 +802,11 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed)
{
	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);
	}
}

/**
 * rproc_coredump_cleanup() - clean up dump_segments list