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

Function rt_mbox_controller_unregister

components/drivers/mailbox/mailbox.c:75–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73}
74
75rt_err_t rt_mbox_controller_unregister(struct rt_mbox_controller *ctrl)
76{
77 struct rt_mbox_chan *chan;
78
79 if (!ctrl)
80 {
81 return -RT_EINVAL;
82 }
83
84 rt_spin_lock(&mbox_ops_lock);
85
86 rt_dm_dev_unbind_fwdata(ctrl->dev, RT_NULL);
87 rt_list_remove(&ctrl->list);
88
89 rt_spin_unlock(&mbox_ops_lock);
90
91 chan = &ctrl->chans[0];
92
93 for (int i = ctrl->num_chans - 1; i >= 0; --i, ++chan)
94 {
95 rt_mbox_release(&ctrl->chans[i]);
96 }
97
98 rt_free(ctrl->chans);
99
100 return RT_EOK;
101}
102
103rt_err_t rt_mbox_send(struct rt_mbox_chan *chan, const void *data,
104 rt_uint32_t timeout_ms)

Callers 1

pic_mbox_removeFunction · 0.85

Calls 6

rt_dm_dev_unbind_fwdataFunction · 0.85
rt_list_removeFunction · 0.85
rt_mbox_releaseFunction · 0.85
rt_freeFunction · 0.85
rt_spin_lockFunction · 0.50
rt_spin_unlockFunction · 0.50

Tested by

no test coverage detected