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

Function clk_create

components/drivers/clk/clk.c:130–149  ·  view source on GitHub ↗

* @brief Allocate memory space and creat clock object * * @param clk_np point to clock node * @param dev_id device identifier for the clock * @param con_id connection identifier for the clock * @param fw_data point to the firmware data associated with the clock * @param fw_node point to the firmware node associated with the clock * * @

Source from the content-addressed store, hash-verified

128 * @return struct rt_clk* point to clock
129 */
130static struct rt_clk *clk_create(struct rt_clk_node *clk_np, const char *dev_id,
131 const char *con_id, void *fw_data, void *fw_node)
132{
133 struct rt_clk *clk = clk_alloc(clk_np, dev_id, con_id, fw_node);
134
135 if (!rt_is_err(clk))
136 {
137 clk_get(clk_np);
138
139 if (clk_np->ops->init && clk_np->ops->init(clk, fw_data))
140 {
141 LOG_E("Dev[%s] Con[%s] init fail", dev_id, con_id);
142
143 clk_free(clk);
144 clk = RT_NULL;
145 }
146 }
147
148 return clk;
149}
150
151/**
152 * @brief Notify corresponding clock from all

Callers 1

ofw_get_clk_no_lockFunction · 0.85

Calls 3

clk_allocFunction · 0.85
clk_freeFunction · 0.85
clk_getFunction · 0.70

Tested by

no test coverage detected