MCPcopy Create free account
hub / github.com/apache/nuttx / rpmsg_unregister_callback

Function rpmsg_unregister_callback

drivers/rpmsg/rpmsg.c:309–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307}
308
309void rpmsg_unregister_callback(FAR void *priv,
310 rpmsg_dev_cb_t device_created,
311 rpmsg_dev_cb_t device_destroy,
312 rpmsg_match_cb_t ns_match,
313 rpmsg_bind_cb_t ns_bind)
314{
315 FAR struct metal_list *node;
316 FAR struct metal_list *pnode;
317
318 down_write(&g_rpmsg_lock);
319 metal_list_for_each(&g_rpmsg_cb, node)
320 {
321 FAR struct rpmsg_cb_s *cb =
322 metal_container_of(node, struct rpmsg_cb_s, node);
323
324 if (cb->priv == priv &&
325 cb->device_created == device_created &&
326 cb->device_destroy == device_destroy &&
327 cb->ns_match == ns_match &&
328 cb->ns_bind == ns_bind)
329 {
330 metal_list_del(&cb->node);
331 kmm_free(cb);
332 break;
333 }
334 }
335
336 downgrade_write(&g_rpmsg_lock);
337 if (device_destroy)
338 {
339 metal_list_for_each(&g_rpmsg, pnode)
340 {
341 FAR struct rpmsg_s *rpmsg =
342 metal_container_of(pnode, struct rpmsg_s, node);
343 FAR struct rpmsg_device *rdev = rpmsg_get_rdev_by_rpmsg(rpmsg);
344
345 if (rpmsg->init)
346 {
347 device_destroy(rdev, priv);
348 }
349 }
350 }
351
352 up_read(&g_rpmsg_lock);
353}
354
355void rpmsg_ns_bind(FAR struct rpmsg_device *rdev,
356 FAR const char *name, uint32_t dest)

Callers 8

mpfs_ihc_initFunction · 0.85
rpmsgmtd_registerFunction · 0.85
rpmsgdev_registerFunction · 0.85
rpmsgblk_registerFunction · 0.85
rpmsg_socket_closeFunction · 0.85
rpmsgfs_client_unbindFunction · 0.85

Calls 5

down_writeFunction · 0.85
kmm_freeFunction · 0.85
downgrade_writeFunction · 0.85
rpmsg_get_rdev_by_rpmsgFunction · 0.85
up_readFunction · 0.85

Tested by

no test coverage detected