Skip to content

Commit e3db688

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: ligd <liguiding1@xiaomi.com>
1 parent e4307e1 commit e3db688

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
@@ -584,6 +584,8 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
584584
metal_mutex_release(&rdev->lock);
585585
if (_ept && _ept->ns_unbind_cb)
586586
_ept->ns_unbind_cb(_ept);
587+
if (rdev->ns_unbind_cb)
588+
rdev->ns_unbind_cb(rdev, name, dest);
587589
} else {
588590
if (!_ept) {
589591
/*

0 commit comments

Comments
 (0)