Source
18
18
#define CMU_MAX_CLKS 37
19
19
20
20
static struct clk_hw_onecell_data *clk_data;
21
21
22
22
static void __init efm32gg_cmu_init(struct device_node *np)
23
23
{
24
24
int i;
25
25
void __iomem *base;
26
26
struct clk_hw **hws;
27
27
28
-
clk_data = kzalloc(sizeof(*clk_data) +
29
-
sizeof(*clk_data->hws) * CMU_MAX_CLKS, GFP_KERNEL);
28
+
clk_data = kzalloc(struct_size(clk_data, hws, CMU_MAX_CLKS),
29
+
GFP_KERNEL);
30
30
31
31
if (!clk_data)
32
32
return;
33
33
34
34
hws = clk_data->hws;
35
35
36
36
for (i = 0; i < CMU_MAX_CLKS; ++i)
37
37
hws[i] = ERR_PTR(-ENOENT);
38
38
39
39
base = of_iomap(np, 0);