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

Function rt_device_unregister

components/drivers/core/device.c:102–112  ·  view source on GitHub ↗

* @brief This function removes a previously registered device driver. * * @param dev is the pointer of device driver structure. * * @return the error code, RT_EOK on successfully. */

Source from the content-addressed store, hash-verified

100 * @return the error code, RT_EOK on successfully.
101 */
102rt_err_t rt_device_unregister(rt_device_t dev)
103{
104 /* parameter check */
105 RT_ASSERT(dev != RT_NULL);
106 RT_ASSERT(rt_object_get_type(&dev->parent) == RT_Object_Class_Device);
107 RT_ASSERT(rt_object_is_systemobject(&dev->parent));
108
109 rt_object_detach(&(dev->parent));
110
111 return RT_EOK;
112}
113RTM_EXPORT(rt_device_unregister);
114
115/**

Callers 15

rt_udisk_stopFunction · 0.85
rt_usbh_adk_disableFunction · 0.85
lwp_tty_deleteFunction · 0.85
i6300esb_wdt_removeFunction · 0.85
dw_wdt_removeFunction · 0.85
rt_sfud_flash_deleteFunction · 0.85
spi_bus_registerFunction · 0.85
rt_device_bus_destroyFunction · 0.85
rt_led_unregisterFunction · 0.85
rt_audio_pipe_detachFunction · 0.85

Calls 3

rt_object_get_typeFunction · 0.85
rt_object_detachFunction · 0.85

Tested by 4

spi_taskFunction · 0.68
spi_taskFunction · 0.68
spi_taskFunction · 0.68