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

Function rt_device_destroy

components/drivers/core/device.c:164–175  ·  view source on GitHub ↗

* @brief This function destroy the specific device object. * * @param dev is a specific device object. */

Source from the content-addressed store, hash-verified

162 * @param dev is a specific device object.
163 */
164void rt_device_destroy(rt_device_t dev)
165{
166 /* parameter check */
167 RT_ASSERT(dev != RT_NULL);
168 RT_ASSERT(rt_object_get_type(&dev->parent) == RT_Object_Class_Null);
169 RT_ASSERT(rt_object_is_systemobject(&dev->parent) == RT_FALSE);
170
171 rt_object_detach(&(dev->parent));
172
173 /* release this device object */
174 rt_free(dev);
175}
176RTM_EXPORT(rt_device_destroy);
177#endif /* RT_USING_HEAP */
178

Callers 4

rt_device_bus_destroyFunction · 0.85
init_sdmmc_deviceFunction · 0.85
xpt2046_hw_initFunction · 0.85

Calls 4

rt_object_get_typeFunction · 0.85
rt_object_detachFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected