MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_dma_controller_unregister

Function rt_dma_controller_unregister

components/drivers/dma/dma.c:60–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60rt_err_t rt_dma_controller_unregister(struct rt_dma_controller *ctrl)
61{
62 if (!ctrl)
63 {
64 return -RT_EINVAL;
65 }
66
67 rt_mutex_take(&ctrl->mutex, RT_WAITING_FOREVER);
68
69 if (!rt_list_isempty(&ctrl->channels_nodes))
70 {
71 rt_mutex_release(&ctrl->mutex);
72 return -RT_EBUSY;
73 }
74
75 if (ctrl->dev->ofw_node)
76 {
77 rt_dm_dev_unbind_fwdata(ctrl->dev, RT_NULL);
78 }
79
80 rt_mutex_release(&ctrl->mutex);
81 rt_mutex_detach(&ctrl->mutex);
82
83 rt_spin_lock(&dmac_nodes_lock);
84 rt_list_remove(&ctrl->list);
85 rt_spin_unlock(&dmac_nodes_lock);
86
87 return RT_EOK;
88}
89
90rt_err_t rt_dma_chan_start(struct rt_dma_chan *chan)
91{

Callers

nothing calls this directly

Calls 8

rt_mutex_takeFunction · 0.85
rt_list_isemptyFunction · 0.85
rt_mutex_releaseFunction · 0.85
rt_dm_dev_unbind_fwdataFunction · 0.85
rt_mutex_detachFunction · 0.85
rt_list_removeFunction · 0.85
rt_spin_lockFunction · 0.50
rt_spin_unlockFunction · 0.50

Tested by

no test coverage detected