Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1490486

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

From Stephen Boyd <sboyd@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration
Date 2016-09-24 00:10 +0200
Message-ID <skGPn-14c-1@gated-at.bofh.it> (permalink)
References <sjLHs-74R-7@gated-at.bofh.it> <sjLHs-74R-33@gated-at.bofh.it> <skGw1-Ig-1@gated-at.bofh.it> <skGPn-14c-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 09/24, Marcin Wojtas wrote:
> Hi Stephen,
> 
> 2016-09-23 23:47 GMT+02:00 Stephen Boyd <sboyd@codeaurora.org>:
> > On 09/21, Marcin Wojtas wrote:
> >> @@ -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?

Yes that looks better.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/3] Armada 7k/8k CP110 system controller fixes Marcin Wojtas <mw@semihalf.com> - 2016-09-21 11:10 +0200
  [PATCH v3 1/3] clk: mvebu: fix setting unwanted flags in CP110 gate clock Marcin Wojtas <mw@semihalf.com> - 2016-09-21 11:10 +0200
    Re: [PATCH v3 1/3] clk: mvebu: fix setting unwanted flags in CP110  gate clock Stephen Boyd <sboyd@codeaurora.org> - 2016-09-23 23:50 +0200
  [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration Marcin Wojtas <mw@semihalf.com> - 2016-09-21 11:10 +0200
    Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to  clk_hw API and registration Stephen Boyd <sboyd@codeaurora.org> - 2016-09-23 23:50 +0200
      Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to  clk_hw API and registration Stephen Boyd <sboyd@codeaurora.org> - 2016-09-24 00:10 +0200
      Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to  clk_hw API and registration Marcin Wojtas <mw@semihalf.com> - 2016-09-24 00:10 +0200
  [PATCH v3 2/3] clk: mvebu: dynamically allocate resources in Armada CP110 system controller Marcin Wojtas <mw@semihalf.com> - 2016-09-21 11:10 +0200
    Re: [PATCH v3 2/3] clk: mvebu: dynamically allocate resources in  Armada CP110 system controller Stephen Boyd <sboyd@codeaurora.org> - 2016-09-23 23:50 +0200

csiph-web