Skip to content

Commit

Permalink
remoteproc: Assign ops and priv to rproc struct in init by default
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
glneo authored and arnopo committed May 16, 2024
1 parent bf87228 commit babba1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/remoteproc/remoteproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit babba1b

Please sign in to comment.