Skip to content

Commit

Permalink
openamp: add ns_unbind_cb to rpmsg_device
Browse files Browse the repository at this point in the history
it's useful to notify the port layer and
also symmetry with ns_bind_cb callback

Signed-off-by: Guiding Li <[email protected]>
  • Loading branch information
GUIDINGLI authored and xiaoxiang781216 committed May 9, 2022
1 parent 8c93bff commit fb557b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/include/openamp/rpmsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ struct rpmsg_device {
unsigned long bitmap[metal_bitmap_longs(RPMSG_ADDR_BMP_SIZE)];
metal_mutex_t lock;
rpmsg_ns_bind_cb ns_bind_cb;
rpmsg_ns_bind_cb ns_unbind_cb;
struct rpmsg_device_ops ops;
bool support_ns;
};
Expand Down
2 changes: 2 additions & 0 deletions lib/rpmsg/rpmsg_virtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,8 @@ static int rpmsg_virtio_ns_callback(struct rpmsg_endpoint *ept, void *data,
metal_mutex_release(&rdev->lock);
if (_ept && _ept->ns_unbind_cb)
_ept->ns_unbind_cb(_ept);
if (rdev->ns_unbind_cb)
rdev->ns_unbind_cb(rdev, name, dest);
} else {
if (!_ept) {
/*
Expand Down

0 comments on commit fb557b2

Please sign in to comment.