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

Function rt_reset_controller_register

components/drivers/reset/reset.c:33–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31#define reset_control_to_array(rstc) rt_container_of(rstc, struct reset_control_array, captain)
32
33rt_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
60rt_err_t rt_reset_controller_unregister(struct rt_reset_controller *rstcer)
61{

Callers 2

reset_simple_probeFunction · 0.85
rk_register_softrstFunction · 0.85

Calls 3

rt_strncpyFunction · 0.85
rt_list_initFunction · 0.85
rt_spin_lock_initFunction · 0.50

Tested by

no test coverage detected