| 31 | #define reset_control_to_array(rstc) rt_container_of(rstc, struct reset_control_array, captain) |
| 32 | |
| 33 | rt_err_t rt_reset_controller_register(struct rt_reset_controller *rstcer) |
| 34 | { |
| 35 | if (!rstcer) |
| 36 | { |
| 37 | return -RT_EINVAL; |
| 38 | } |
| 39 | |
| 40 | #if RT_NAME_MAX > 0 |
| 41 | rt_strncpy(rstcer->parent.name, RT_RESET_CONTROLLER_OBJ_NAME, RT_NAME_MAX); |
| 42 | #else |
| 43 | rstcer->parent.name = RT_RESET_CONTROLLER_OBJ_NAME; |
| 44 | #endif |
| 45 | |
| 46 | rt_list_init(&rstcer->rstc_nodes); |
| 47 | rt_spin_lock_init(&rstcer->spinlock); |
| 48 | |
| 49 | if (rstcer->ofw_node) |
| 50 | { |
| 51 | if (!rt_ofw_data(rstcer->ofw_node)) |
| 52 | { |
| 53 | rt_ofw_data(rstcer->ofw_node) = rstcer; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | return RT_EOK; |
| 58 | } |
| 59 | |
| 60 | rt_err_t rt_reset_controller_unregister(struct rt_reset_controller *rstcer) |
| 61 | { |
no test coverage detected