From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970183AbdDTO7I (ORCPT ); Thu, 20 Apr 2017 10:59:08 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:50065 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964853AbdDTO7F (ORCPT ); Thu, 20 Apr 2017 10:59:05 -0400 Subject: Re: [PATCH] clk: ti: fix linker error with !SOC_OMAP4 To: Arnd Bergmann , Michael Turquette , Stephen Boyd References: <20170419214318.1605787-1-arnd@arndb.de> CC: Tony Lindgren , Richard Watts , , , From: Tero Kristo Message-ID: <9df5f73d-3e3a-ee33-1b75-c14a1a707ad9@ti.com> Date: Thu, 20 Apr 2017 17:57:39 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170419214318.1605787-1-arnd@arndb.de> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/04/17 00:43, Arnd Bergmann wrote: > When none of the OMAP4-generation SoCs are enabled, we run into a link > error for am43xx/am43xx: > > drivers/clk/ti/dpll.o: In function `of_ti_am3_dpll_x2_setup': > dpll.c:(.init.text+0xd8): undefined reference to `clkhwops_omap4_dpllmx' > > This is easily fixed by adding another #ifdef. > > While looking at the code, I also spotted another problem with the > assignment of hw_ops variable that is not used again later. I'm > changing this to setting clk_hw->ops instead, which I guess is what > was intended here. Good catch... It seems the corner case is masked in the testing I did locally so far. > > Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to clock driver") However, I believe the fixes tag should point to this one in linux-next: commit 473adbf4e02857a6b78dfb3d9fcf752638bbadb9 Author: Tero Kristo Date: Thu Feb 9 11:25:28 2017 +0200 clk: ti: dpll44xx: fix clksel register initialization > Signed-off-by: Arnd Bergmann Other than that: Acked-by: Tero Kristo > --- > drivers/clk/ti/dpll.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c > index 96d84888c6c5..fcf297fd2233 100644 > --- a/drivers/clk/ti/dpll.c > +++ b/drivers/clk/ti/dpll.c > @@ -312,7 +312,6 @@ static void _register_dpll_x2(struct device_node *node, > struct clk_hw_omap *clk_hw; > const char *name = node->name; > const char *parent_name; > - int ret; > > parent_name = of_clk_get_parent_name(node, 0); > if (!parent_name) { > @@ -332,16 +331,21 @@ static void _register_dpll_x2(struct device_node *node, > init.parent_names = &parent_name; > init.num_parents = 1; > > +#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) || \ > + defined(CONFIG_SOC_DRA7XX) > if (hw_ops == &clkhwops_omap4_dpllmx) { > + int ret; > + > /* Check if register defined, if not, drop hw-ops */ > ret = of_property_count_elems_of_size(node, "reg", 1); > if (ret <= 0) { > - hw_ops = NULL; > + clk_hw->ops = NULL; > } else if (ti_clk_get_reg_addr(node, 0, &clk_hw->clksel_reg)) { > kfree(clk_hw); > return; > } > } > +#endif > > /* register the clock */ > clk = ti_clk_register(NULL, &clk_hw->hw, name); >