* This function will suspend all registered devices */
| 109 | * This function will suspend all registered devices |
| 110 | */ |
| 111 | static rt_err_t _pm_device_suspend(rt_uint8_t mode) |
| 112 | { |
| 113 | rt_err_t ret = RT_EOK; |
| 114 | struct rt_device_pm *device_pm = RT_NULL; |
| 115 | rt_slist_t *node = RT_NULL; |
| 116 | |
| 117 | for (node = rt_slist_first(&_pm.device_list); node; node = rt_slist_next(node)) |
| 118 | { |
| 119 | device_pm = rt_slist_entry(node, struct rt_device_pm, list); |
| 120 | if (device_pm->ops != RT_NULL && device_pm->ops->suspend != RT_NULL) |
| 121 | { |
| 122 | ret = device_pm->ops->suspend(device_pm->device, mode); |
| 123 | if(ret != RT_EOK) |
| 124 | { |
| 125 | break; |
| 126 | } |
| 127 | } |
| 128 | } |
| 129 | |
| 130 | return ret; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * This function will resume all registered devices |
no test coverage detected