Skip to content

Commit fb557b2

Browse files
GUIDINGLIxiaoxiang781216
authored andcommitted
openamp: add ns_unbind_cb to rpmsg_device
it's useful to notify the port layer and also symmetry with ns_bind_cb callback Signed-off-by: Guiding Li <liguiding1@xiaomi.com>
1 parent 8c93bff commit fb557b2

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

lib/include/openamp/rpmsg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct rpmsg_device {
118118
unsigned long bitmap[metal_bitmap_longs(RPMSG_ADDR_BMP_SIZE)];
119119
metal_mutex_t lock;
120120
rpmsg_ns_bind_cb ns_bind_cb;
121+
rpmsg_ns_bind_cb ns_unbind_cb;
121122
struct rpmsg_device_ops ops;
122123
bool support_ns;
123124
};

lib/rpmsg/rpmsg_virtio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,8 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
585585
metal_mutex_release(&rdev->lock);
586586
if (_ept && _ept->ns_unbind_cb)
587587
_ept->ns_unbind_cb(_ept);
588+
if (rdev->ns_unbind_cb)
589+
rdev->ns_unbind_cb(rdev, name, dest);
588590
} else {
589591
if (!_ept) {
590592
/*

0 commit comments

Comments
 (0)