Commit 618fcff3 authored by Bjorn Andersson's avatar Bjorn Andersson

remoteproc: Rename subdev functions to start/stop

"start" and "stop" are more suitable names for how these two operations
are used, and they fit better with the upcoming introduction of two
additional operations in the struct.
Tested-by: default avatarFabien Dessenne <fabien.dessenne@st.com>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
[elder@linaro.org: minor comment edits]
Signed-off-by Alex Elder <elder@linaro.org>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 3a3d4163
...@@ -774,13 +774,13 @@ static int rproc_handle_resources(struct rproc *rproc, ...@@ -774,13 +774,13 @@ static int rproc_handle_resources(struct rproc *rproc,
return ret; return ret;
} }
static int rproc_probe_subdevices(struct rproc *rproc) static int rproc_start_subdevices(struct rproc *rproc)
{ {
struct rproc_subdev *subdev; struct rproc_subdev *subdev;
int ret; int ret;
list_for_each_entry(subdev, &rproc->subdevs, node) { list_for_each_entry(subdev, &rproc->subdevs, node) {
ret = subdev->probe(subdev); ret = subdev->start(subdev);
if (ret) if (ret)
goto unroll_registration; goto unroll_registration;
} }
...@@ -789,17 +789,17 @@ static int rproc_probe_subdevices(struct rproc *rproc) ...@@ -789,17 +789,17 @@ static int rproc_probe_subdevices(struct rproc *rproc)
unroll_registration: unroll_registration:
list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node)
subdev->remove(subdev, true); subdev->stop(subdev, true);
return ret; return ret;
} }
static void rproc_remove_subdevices(struct rproc *rproc, bool crashed) static void rproc_stop_subdevices(struct rproc *rproc, bool crashed)
{ {
struct rproc_subdev *subdev; struct rproc_subdev *subdev;
list_for_each_entry_reverse(subdev, &rproc->subdevs, node) list_for_each_entry_reverse(subdev, &rproc->subdevs, node)
subdev->remove(subdev, crashed); subdev->stop(subdev, crashed);
} }
/** /**
...@@ -901,8 +901,8 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw) ...@@ -901,8 +901,8 @@ static int rproc_start(struct rproc *rproc, const struct firmware *fw)
return ret; return ret;
} }
/* probe any subdevices for the remote processor */ /* Start any subdevices for the remote processor */
ret = rproc_probe_subdevices(rproc); ret = rproc_start_subdevices(rproc);
if (ret) { if (ret) {
dev_err(dev, "failed to probe subdevices for %s: %d\n", dev_err(dev, "failed to probe subdevices for %s: %d\n",
rproc->name, ret); rproc->name, ret);
...@@ -1014,8 +1014,8 @@ static int rproc_stop(struct rproc *rproc, bool crashed) ...@@ -1014,8 +1014,8 @@ static int rproc_stop(struct rproc *rproc, bool crashed)
struct device *dev = &rproc->dev; struct device *dev = &rproc->dev;
int ret; int ret;
/* remove any subdevices for the remote processor */ /* Stop any subdevices for the remote processor */
rproc_remove_subdevices(rproc, crashed); rproc_stop_subdevices(rproc, crashed);
/* the installed resource table is no longer accessible */ /* the installed resource table is no longer accessible */
rproc->table_ptr = rproc->cached_table; rproc->table_ptr = rproc->cached_table;
...@@ -1657,16 +1657,16 @@ EXPORT_SYMBOL(rproc_del); ...@@ -1657,16 +1657,16 @@ EXPORT_SYMBOL(rproc_del);
* rproc_add_subdev() - add a subdevice to a remoteproc * rproc_add_subdev() - add a subdevice to a remoteproc
* @rproc: rproc handle to add the subdevice to * @rproc: rproc handle to add the subdevice to
* @subdev: subdev handle to register * @subdev: subdev handle to register
* @probe: function to call when the rproc boots * @start: function to call after the rproc is started
* @remove: function to call when the rproc shuts down * @stop: function to call before the rproc is stopped
*/ */
void rproc_add_subdev(struct rproc *rproc, void rproc_add_subdev(struct rproc *rproc,
struct rproc_subdev *subdev, struct rproc_subdev *subdev,
int (*probe)(struct rproc_subdev *subdev), int (*start)(struct rproc_subdev *subdev),
void (*remove)(struct rproc_subdev *subdev, bool crashed)) void (*stop)(struct rproc_subdev *subdev, bool crashed))
{ {
subdev->probe = probe; subdev->start = start;
subdev->remove = remove; subdev->stop = stop;
list_add_tail(&subdev->node, &rproc->subdevs); list_add_tail(&subdev->node, &rproc->subdevs);
} }
......
...@@ -477,15 +477,15 @@ struct rproc { ...@@ -477,15 +477,15 @@ struct rproc {
/** /**
* struct rproc_subdev - subdevice tied to a remoteproc * struct rproc_subdev - subdevice tied to a remoteproc
* @node: list node related to the rproc subdevs list * @node: list node related to the rproc subdevs list
* @probe: probe function, called as the rproc is started * @start: start function, called after the rproc has been started
* @remove: remove function, called as the rproc is being stopped, the @crashed * @stop: stop function, called before the rproc is stopped; the @crashed
* parameter indicates if this originates from the a recovery * parameter indicates if this originates from a recovery
*/ */
struct rproc_subdev { struct rproc_subdev {
struct list_head node; struct list_head node;
int (*probe)(struct rproc_subdev *subdev); int (*start)(struct rproc_subdev *subdev);
void (*remove)(struct rproc_subdev *subdev, bool crashed); void (*stop)(struct rproc_subdev *subdev, bool crashed);
}; };
/* we currently support only two vrings per rvdev */ /* we currently support only two vrings per rvdev */
...@@ -568,8 +568,8 @@ static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev) ...@@ -568,8 +568,8 @@ static inline struct rproc *vdev_to_rproc(struct virtio_device *vdev)
void rproc_add_subdev(struct rproc *rproc, void rproc_add_subdev(struct rproc *rproc,
struct rproc_subdev *subdev, struct rproc_subdev *subdev,
int (*probe)(struct rproc_subdev *subdev), int (*start)(struct rproc_subdev *subdev),
void (*remove)(struct rproc_subdev *subdev, bool crashed)); void (*stop)(struct rproc_subdev *subdev, bool crashed));
void rproc_remove_subdev(struct rproc *rproc, struct rproc_subdev *subdev); void rproc_remove_subdev(struct rproc *rproc, struct rproc_subdev *subdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment