Thread (9 messages) flat view 9 messages, 2 authors, 2016-09-23

[PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration

From: Marcin Wojtas <hidden>
Date: 2016-09-23 22:00:05
Also in: linux-clk, lkml

Hi Stephen,

2016-09-23 23:47 GMT+02:00 Stephen Boyd [off-list ref]:
On 09/21, Marcin Wojtas wrote:
quoted
@@ -203,80 +202,75 @@ static int cp110_syscon_clk_probe(struct platform_device *pdev)
      if (ret)
              return ret;

-     cp110_clks = devm_kcalloc(&pdev->dev, sizeof(struct clk *),
-                               CP110_CLK_NUM, GFP_KERNEL);
-     if (!cp110_clks)
-             return -ENOMEM;
-
-     cp110_clk_data = devm_kzalloc(&pdev->dev,
-                                   sizeof(*cp110_clk_data),
+     cp110_clk_data = devm_kcalloc(&pdev->dev, sizeof(*cp110_clk_data),
+                                   sizeof(struct clk_hw *) * CP110_CLK_NUM,
                                    GFP_KERNEL);
This doesn't look right. Why are calloc()ing clk_hw_onecell_data this
way?
After some time, at a first sight it seems I should've used following:
cp110_clk_data = devm_kzalloc(&pdev->dev, sizeof(*cp110_clk_data) +
                                                    sizeof(struct
clk_hw *) * CP110_CLK_NUM,
                                                    GFP_KERNEL);

I'll re-check, but is that what you meant?

Best regards,
Marcin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help