* @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 * * @
| 128 | * @return struct rt_clk* point to clock |
| 129 | */ |
| 130 | static 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 |
no test coverage detected