From aab8d8022304b646fbf6eed5f6ac9bc21d54d2fd Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Wed, 19 Oct 2016 19:40:06 -0700 Subject: remoteproc: Assign kref to rproc_vdev No functional change Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/remoteproc/remoteproc_core.c') diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index b5e314fe1f4c..67f581d0c488 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -356,6 +356,8 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, if (!rvdev) return -ENOMEM; + kref_init(&rvdev->refcount); + rvdev->rproc = rproc; /* parse the vrings */ @@ -384,6 +386,14 @@ free_rvdev: return ret; } +void rproc_vdev_release(struct kref *ref) +{ + struct rproc_vdev *rvdev = container_of(ref, struct rproc_vdev, refcount); + + list_del(&rvdev->node); + kfree(rvdev); +} + /** * rproc_handle_trace() - handle a shared trace buffer resource * @rproc: the remote processor -- cgit v1.2.3-59-g8ed1b