remoteproc: Assign ops and priv to rproc struct in init by default

These need to be set in the rproc specific init() callback currently,
instead set them before calling the callback to make doing that in the
callback optional.

They can still be overwritten if needed in the init() callback but
if this is not needed as in some simple cases, then the callback is
not needed. Like other functions here, make this optional if no
additional modifications to the rproc struct are needed.

Signed-off-by: Andrew Davis <afd@ti.com>
This commit is contained in:
Andrew Davis
2024-04-23 10:08:23 -05:00
committed by Arnaud Pouliquen
parent bf87228730
commit babba1bca0

View File

@@ -179,10 +179,13 @@ struct remoteproc *remoteproc_init(struct remoteproc *rproc,
memset(rproc, 0, sizeof(*rproc));
rproc->state = RPROC_OFFLINE;
rproc->ops = ops;
rproc->priv = priv;
metal_mutex_init(&rproc->lock);
metal_list_init(&rproc->mems);
metal_list_init(&rproc->vdevs);
rproc = ops->init(rproc, ops, priv);
if (ops->init)
rproc = ops->init(rproc, ops, priv);
return rproc;
}