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

Function fixed_clk_probe

components/drivers/clk/clk-fixed-rate.c:45–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45static rt_err_t fixed_clk_probe(struct rt_platform_device *pdev)
46{
47 rt_err_t err = RT_EOK;
48 struct rt_clk_fixed_rate *clk_fixed = rt_calloc(1, sizeof(*clk_fixed));
49
50 if (clk_fixed)
51 {
52 err = fixed_clk_ofw_init(pdev, clk_fixed);
53 }
54 else
55 {
56 err = -RT_ENOMEM;
57 }
58
59 if (!err)
60 {
61 err = rt_clk_register(&clk_fixed->clk, RT_NULL);
62 }
63
64 if (err && clk_fixed)
65 {
66 rt_free(clk_fixed);
67 }
68
69 return err;
70}
71
72static const struct rt_ofw_node_id fixed_clk_ofw_ids[] =
73{

Callers

nothing calls this directly

Calls 4

rt_callocFunction · 0.85
fixed_clk_ofw_initFunction · 0.85
rt_clk_registerFunction · 0.85
rt_freeFunction · 0.85

Tested by

no test coverage detected