From patchwork Thu May 12 08:30:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 9077591 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8FAF8BF29F for ; Thu, 12 May 2016 08:30:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 74B042020F for ; Thu, 12 May 2016 08:30:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id D21A7201FE for ; Thu, 12 May 2016 08:30:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEDB66E7DB; Thu, 12 May 2016 08:30:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (down.free-electrons.com [37.187.137.238]) by gabe.freedesktop.org (Postfix) with ESMTP id 4D4676E7DB for ; Thu, 12 May 2016 08:30:49 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 3C25A645; Thu, 12 May 2016 10:30:48 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (LFbn-1-2034-31.w90-76.abo.wanadoo.fr [90.76.103.31]) by mail.free-electrons.com (Postfix) with ESMTPSA id F418E12D; Thu, 12 May 2016 10:30:47 +0200 (CEST) Date: Thu, 12 May 2016 10:30:47 +0200 From: Maxime Ripard To: Priit Laes Subject: Re: [linux-sunxi] Re: [PATCH v4 01/11] clk: sunxi: Add display and TCON0 clocks driver Message-ID: <20160512083047.GY3733@lukather> References: <1461590572-4027-1-git-send-email-maxime.ripard@free-electrons.com> <1461590572-4027-2-git-send-email-maxime.ripard@free-electrons.com> <20160506223002.GE3492@codeaurora.org> <20160508200308.GF6167@lukather> <20160509223238.GW3492@codeaurora.org> <20160509223924.GX3492@codeaurora.org> <1462907459.9981.0.camel@plaes.org> <20160511221541.GG3492@codeaurora.org> <1463024360.16747.4.camel@plaes.org> <20160512065943.GX3733@lukather> MIME-Version: 1.0 In-Reply-To: <20160512065943.GX3733@lukather> User-Agent: Mutt/1.5.24 (2015-08-30) Cc: Thomas Petazzoni , devicetree@vger.kernel.org, Mike Turquette , linux-sunxi@googlegroups.com, Stephen Boyd , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Hans de Goede , Chen-Yu Tsai , Rob Herring , Laurent Pinchart , Alexander Kaplan , linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, May 12, 2016 at 08:59:43AM +0200, Maxime Ripard wrote: > On Thu, May 12, 2016 at 06:39:20AM +0300, Priit Laes wrote: > > On Wed, 2016-05-11 at 15:15 -0700, Stephen Boyd wrote: > > > On 05/10, Priit Laes wrote: > > > > > > > > On Mon, 2016-05-09 at 15:39 -0700, Stephen Boyd wrote: > > > > > > > > > > On 05/09, Stephen Boyd wrote: > > > > > > > > > > > > > > > > > > > > > > > > Ok I applied this one to clk-next. > > > > > > > > > > > And I squashed this in to silence the following checker warning. > > > > > > > > > > drivers/clk/sunxi/clk-sun4i-display.c:110:33: warning: Variable > > > > > length array is used. > > > > > > > > > > ---8<--- > > > > > diff --git a/drivers/clk/sunxi/clk-sun4i-display.c > > > > > b/drivers/clk/sunxi/clk-sun4i-display.c > > > > > index f02e250e64ed..f8ff6c4a5633 100644 > > > > > --- a/drivers/clk/sunxi/clk-sun4i-display.c > > > > > +++ b/drivers/clk/sunxi/clk-sun4i-display.c > > > > > @@ -107,7 +107,7 @@ static int > > > > > sun4i_a10_display_reset_xlate(struct > > > > > reset_controller_dev *rcdev, > > > > >  static void __init sun4i_a10_display_init(struct device_node > > > > > *node, > > > > >     const struct > > > > > sun4i_a10_display_clk_data *data) > > > > >  { > > > > > - const char *parents[data->parents]; > > > > > + const char *parents[4]; > > > > This change breaks at least de_[bf]e clocks which have 3 clock > > > > parents. > > > > > I just used the largest data->parents number, which was 4. How > > > does that break anything? > > > > If you look at the sun4i_a10_display_init, it contains this block: > > > >     ret = of_clk_parent_fill(node, parents, ARRAY_SIZE(parents)); > >     if (ret != ARRAY_SIZE(parents)) { > >         pr_err("%s: Could not retrieve the parents\n", clk_name); > >         goto unmap; > >     } > > > > of_clk_parent_fill returns 3 for de_be/de_fe nodes, and > > ARRAY_SIZE(parents) is 4. > > Replacing both ARRAY_SIZE(parents) by data->parents would work though. I just tested on top of current next, and indeed the following patch is needed. Stephen, could you squash it in the former patch? Thanks! Maxime diff --git a/drivers/clk/sunxi/clk-sun4i-display.c b/drivers/clk/sunxi/clk-sun4i-display.c index 70803aa7028c..9780fac6d029 100644 --- a/drivers/clk/sunxi/clk-sun4i-display.c +++ b/drivers/clk/sunxi/clk-sun4i-display.c @@ -128,8 +128,8 @@ static void __init sun4i_a10_display_init(struct device_node *node, return; } - ret = of_clk_parent_fill(node, parents, ARRAY_SIZE(parents)); - if (ret != ARRAY_SIZE(parents)) { + ret = of_clk_parent_fill(node, parents, data->parents); + if (ret != data->parents) { pr_err("%s: Could not retrieve the parents\n", clk_name); goto unmap; }