diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c index fbf79f43e..7d2ff2067 100644 --- a/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c +++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_client.c @@ -222,6 +222,7 @@ int main(int argc, char *argv[]) ret = rpmsg_register_callback(&priv, usrsock_rpmsg_device_created, usrsock_rpmsg_device_destroy, + NULL, NULL); if (ret < 0) { @@ -318,6 +319,7 @@ unregister_callback: rpmsg_unregister_callback(&priv, usrsock_rpmsg_device_created, usrsock_rpmsg_device_destroy, + NULL, NULL); destroy_sem: sem_destroy(&priv.sem); diff --git a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c index 9ade0b7dd..0c8407898 100644 --- a/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c +++ b/netutils/usrsock_rpmsg/usrsock_rpmsg_server.c @@ -112,6 +112,8 @@ static int usrsock_rpmsg_dns_handler(struct rpmsg_endpoint *ept, void *data, size_t len, uint32_t src, void *priv_); +static bool usrsock_rpmsg_ns_match(struct rpmsg_device *rdev, void *priv_, + const char *name, uint32_t dest); static void usrsock_rpmsg_ns_bind(struct rpmsg_device *rdev, void *priv_, const char *name, uint32_t dest); static void usrsock_rpmsg_ns_unbind(struct rpmsg_endpoint *ept); @@ -822,6 +824,12 @@ static int usrsock_rpmsg_send_dns_event(void *arg, } #endif +static bool usrsock_rpmsg_ns_match(struct rpmsg_device *rdev, void *priv_, + const char *name, uint32_t dest) +{ + return !strcmp(name, USRSOCK_RPMSG_EPT_NAME); +} + static void usrsock_rpmsg_ns_bind(struct rpmsg_device *rdev, void *priv_, const char *name, uint32_t dest) { @@ -829,11 +837,6 @@ static void usrsock_rpmsg_ns_bind(struct rpmsg_device *rdev, void *priv_, struct rpmsg_endpoint *ept; int ret; - if (strcmp(name, USRSOCK_RPMSG_EPT_NAME)) - { - return; - } - ept = zalloc(sizeof(struct rpmsg_endpoint)); if (!ept) { @@ -1069,6 +1072,7 @@ int main(int argc, char *argv[]) ret = rpmsg_register_callback(priv, NULL, NULL, + usrsock_rpmsg_ns_match, usrsock_rpmsg_ns_bind); if (ret < 0) { @@ -1097,6 +1101,7 @@ int main(int argc, char *argv[]) rpmsg_unregister_callback(priv, NULL, NULL, + usrsock_rpmsg_ns_match, usrsock_rpmsg_ns_bind); free_fd: close(fd);