* @brief This function call all buses' shutdown * * @return the error code, RT_EOK on shutdown successfully. */
| 418 | * @return the error code, RT_EOK on shutdown successfully. |
| 419 | */ |
| 420 | rt_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 |
nothing calls this directly
no test coverage detected