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

Function rt_bus_shutdown

components/drivers/core/bus.c:420–439  ·  view source on GitHub ↗

* @brief This function call all buses' shutdown * * @return the error code, RT_EOK on shutdown successfully. */

Source from the content-addressed store, hash-verified

418 * @return the error code, RT_EOK on shutdown successfully.
419 */
420rt_err_t rt_bus_shutdown(void)
421{
422 rt_bus_t bus = RT_NULL;
423 struct bus_shutdown_info info =
424 {
425 .err = RT_EOK,
426 };
427
428 _dm_bus_lock(&bus_lock);
429
430 rt_list_for_each_entry(bus, &bus_nodes, list)
431 {
432 info.bus = bus;
433 rt_bus_for_each_dev(bus, &info, device_shutdown);
434 }
435
436 _dm_bus_unlock(&bus_lock);
437
438 return info.err;
439}
440
441/**
442 * @brief This function find a bus by name

Callers

nothing calls this directly

Calls 3

_dm_bus_lockFunction · 0.85
rt_bus_for_each_devFunction · 0.85
_dm_bus_unlockFunction · 0.85

Tested by

no test coverage detected