mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
rpmsg: Release rpmsg devices in backends
The rpmsg devices are allocated in the backends and as such must be freed there as well. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
@@ -360,6 +360,14 @@ static const struct rpmsg_device_ops virtio_rpmsg_ops = {
|
||||
.announce_destroy = virtio_rpmsg_announce_destroy,
|
||||
};
|
||||
|
||||
static void virtio_rpmsg_release_device(struct device *dev)
|
||||
{
|
||||
struct rpmsg_device *rpdev = to_rpmsg_device(dev);
|
||||
struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev);
|
||||
|
||||
kfree(vch);
|
||||
}
|
||||
|
||||
/*
|
||||
* create an rpmsg channel using its name and address info.
|
||||
* this function will be used to create both static and dynamic
|
||||
@@ -408,6 +416,7 @@ static struct rpmsg_device *rpmsg_create_channel(struct virtproc_info *vrp,
|
||||
strncpy(rpdev->id.name, chinfo->name, RPMSG_NAME_SIZE);
|
||||
|
||||
rpdev->dev.parent = &vrp->vdev->dev;
|
||||
rpdev->dev.release = virtio_rpmsg_release_device;
|
||||
ret = rpmsg_register_device(rpdev);
|
||||
if (ret)
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user