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

Function rpmsg_virtio_remove

drivers/rpmsg/rpmsg_virtio.c:729–766  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

727 ****************************************************************************/
728
729void rpmsg_virtio_remove(FAR struct virtio_device *vdev)
730{
731 FAR struct rpmsg_virtio_priv_s *priv =
732 metal_container_of(vdev->priv, struct rpmsg_virtio_priv_s, rvdev);
733 char name[64];
734
735 /* Unregister the rpmsg */
736
737 snprintf(name, sizeof(name), "/dev/rpmsg/%s", priv->rpmsg.cpuname);
738 rpmsg_unregister(name, &priv->rpmsg);
739
740 /* Disable tx buffer return callback */
741
742 virtqueue_disable_cb(priv->rvdev.svq);
743
744 /* Destroy all the rpmsg services */
745
746 rpmsg_device_destory(&priv->rpmsg);
747
748 /* Reset the rpmsg virtio device for driver */
749
750 if (vdev->role == VIRTIO_DEV_DRIVER)
751 {
752 virtio_reset_device(vdev);
753 }
754
755 /* Deinit the rpmsg virtio device */
756
757 rpmsg_deinit_vdev(&priv->rvdev);
758
759 /* Delete the kthread */
760
761 kthread_delete(priv->tid);
762
763 /* Free the private data */
764
765 kmm_free(priv);
766}

Callers 1

rptun_unregister_deviceFunction · 0.85

Calls 4

rpmsg_unregisterFunction · 0.85
rpmsg_device_destoryFunction · 0.85
kmm_freeFunction · 0.85
snprintfFunction · 0.50

Tested by

no test coverage detected