aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/remoteproc/remoteproc_core.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2018-06-26 07:11:57 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-06-26 13:53:07 -0700
commit4902676f04acc20fe12e49f5f4916f2659c2a7bc (patch)
treefadf7b89ad14b1ed27b91662b5ca724baccae6f5 /drivers/remoteproc/remoteproc_core.c
parentremoteproc: Make start and stop in subdev optional (diff)
downloadwireguard-linux-4902676f04acc20fe12e49f5f4916f2659c2a7bc.tar.xz
wireguard-linux-4902676f04acc20fe12e49f5f4916f2659c2a7bc.zip
remoteproc: Make client initialize ops in rproc_subdev
In preparation of adding the additional prepare and unprepare operations make the client responsible for filling out the function pointers of the rproc_subdev. This makes the arguments to rproc_add_subdev() more manageable, in particular when some of the functions are left out. Tested-by: Fabien Dessenne <fabien.dessenne@st.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> [elder@linaro.org: added comment about assigning function pointers] Signed-off-by Alex Elder <elder@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers/remoteproc/remoteproc_core.c')
-rw-r--r--drivers/remoteproc/remoteproc_core.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 981ae6dff145..ca39fad175f2 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -399,8 +399,10 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc,
list_add_tail(&rvdev->node, &rproc->rvdevs);
- rproc_add_subdev(rproc, &rvdev->subdev,
- rproc_vdev_do_probe, rproc_vdev_do_remove);
+ rvdev->subdev.start = rproc_vdev_do_probe;
+ rvdev->subdev.stop = rproc_vdev_do_remove;
+
+ rproc_add_subdev(rproc, &rvdev->subdev);
return 0;
@@ -1663,17 +1665,11 @@ EXPORT_SYMBOL(rproc_del);
* rproc_add_subdev() - add a subdevice to a remoteproc
* @rproc: rproc handle to add the subdevice to
* @subdev: subdev handle to register
- * @start: function to call after the rproc is started
- * @stop: function to call before the rproc is stopped
+ *
+ * Caller is responsible for populating optional subdevice function pointers.
*/
-void rproc_add_subdev(struct rproc *rproc,
- struct rproc_subdev *subdev,
- int (*start)(struct rproc_subdev *subdev),
- void (*stop)(struct rproc_subdev *subdev, bool crashed))
+void rproc_add_subdev(struct rproc *rproc, struct rproc_subdev *subdev)
{
- subdev->start = start;
- subdev->stop = stop;
-
list_add_tail(&subdev->node, &rproc->subdevs);
}
EXPORT_SYMBOL(rproc_add_subdev);