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


Groups > linux.kernel > #1490487

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

Path csiph.com!weretis.net!feeder4.news.weretis.net!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Marcin Wojtas <mw@semihalf.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/3] clk: mvebu: migrate CP110 system controller to clk_hw API and registration
Date Sat, 24 Sep 2016 00:10:01 +0200
Message-ID <skGPn-14c-3@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>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=PD217xYdRP7zEZL4ffPO7ge6ADLshoSduCnZhNbcB5I=; b=07qRFEhqwFeunnCVuoPzHW+Tx9WXv6Renkz39oRMT1/dGMXBtCph5oZiHN6csC4jvS FajKaYT8+vNRx+j1cYQ3H2avscLqQ0e2Wo2z2goAtmvJw0rlOLT/5td6cbAFJhFaVR1n AlsZTNRdlfnzm400KITnYbO0SwiXp0VJe9AP0iUpxExT5QH91viLmbzJLaBfq9kFFZ9H 9oigZfDTRmTdtjsnAzghCFYQ9dplUx3GGYiU4aE5zXKSJYJLoTX+Vak4qMH0l7JSazvu sY4U9s8qhjEsJS52d44/t/TSsFbupofemu91nfefioYuL4dYSuAL3uAKebSUqrAOY7ao PPsw==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=PD217xYdRP7zEZL4ffPO7ge6ADLshoSduCnZhNbcB5I=; b=LhBOfEHremOTwfArf91ZRLhIFFUaPg54iTX4wlxIjjKujKsqdKG0e8io3pvafj2XEo hx9B7ZlTrNR281xDfPK3TGTXwDLeekPyWhyy/qXJVnfgAl5qR/ockXarAoRqmMEekFrf ZWBO5nI2QEUPIcdLMZKPg1gm3luN9CvIhzyRUlJV/FpA3Iagmuwzyx8q1JMXw0ySxCdW ypaVTwj5kJ4lrqVN0TYTfkImLNrJk/QJZK7OE9kcCbyaApGTlfSR1/V4gC6bzs/Byi6a MY5riHWouzA9bm+rvFvJI3p1WlKMtmE9l5f8PEs7QAvX1oZIcJR6LI8UbMj/ygGiuTl7 +5PQ==
X-Gm-Message-State AE9vXwPkQWgmvtem9sXNro1tIYO22hpK7mANsEEenrOjRp9QxX2f2yJw/LUEnwoqMtQMXfyHQXO3WdKHanyVbw==
X-Received by 10.107.8.165 with SMTP id h37mr11355938ioi.45.1474668001879; Fri, 23 Sep 2016 15:00:01 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 32
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, "linux-arm-kernel@lists.infradead.org" <linux-arm-kernel@lists.infradead.org>, linux-clk@vger.kernel.org, Michael Turquette <mturquette@baylibre.com>, Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>, Andrew Lunn <andrew@lunn.ch>, Jason Cooper <jason@lakedaemon.net>, Thomas Petazzoni <thomas.petazzoni@free-electrons.com>, Gregory Clément <gregory.clement@free-electrons.com>, nadavh@marvell.com, Lior Amsalem <alior@marvell.com>, Tomasz Nowicki <tn@semihalf.com>, Grzegorz Jaszczyk <jaz@semihalf.com>
X-Original-Date Sat, 24 Sep 2016 00:00:01 +0200
X-Original-Message-ID <CAPv3WKfDrtDDMPi4oBmpNN_+b4mvG6cVnZT7pNTo8tcNUyzwyA@mail.gmail.com>
X-Original-References <1474448759-24482-1-git-send-email-mw@semihalf.com> <1474448759-24482-4-git-send-email-mw@semihalf.com> <20160923214730.GF21232@codeaurora.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1490487

Show key headers only | View raw


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?

Best regards,
Marcin

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