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

Function rpmsgfs_client_bind

fs/rpmsgfs/rpmsgfs_client.c:739–772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

737}
738
739int rpmsgfs_client_bind(FAR void **handle, FAR const char *cpuname)
740{
741 struct rpmsgfs_s *priv;
742 int ret;
743
744 if (!cpuname)
745 {
746 return -EINVAL;
747 }
748
749 priv = fs_heap_zalloc(sizeof(struct rpmsgfs_s));
750 if (!priv)
751 {
752 return -ENOMEM;
753 }
754
755 nxsem_init(&priv->wait, 0, 0);
756 strlcpy(priv->cpuname, cpuname, sizeof(priv->cpuname));
757 ret = rpmsg_register_callback(priv,
758 rpmsgfs_device_created,
759 rpmsgfs_device_destroy,
760 NULL,
761 NULL);
762 if (ret < 0)
763 {
764 nxsem_destroy(&priv->wait);
765 fs_heap_free(priv);
766 return ret;
767 }
768
769 *handle = priv;
770
771 return 0;
772}
773
774int rpmsgfs_client_unbind(FAR void *handle)
775{

Callers 1

rpmsgfs_bindFunction · 0.85

Calls 6

fs_heap_zallocFunction · 0.85
nxsem_initFunction · 0.85
rpmsg_register_callbackFunction · 0.85
nxsem_destroyFunction · 0.85
fs_heap_freeFunction · 0.85
strlcpyFunction · 0.50

Tested by

no test coverage detected