From patchwork Wed Apr 19 21:43:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9689091 X-Patchwork-Delegate: sboyd@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B840602DC for ; Wed, 19 Apr 2017 21:43:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C35F28387 for ; Wed, 19 Apr 2017 21:43:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E3B12842E; Wed, 19 Apr 2017 21:43:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E001B28178 for ; Wed, 19 Apr 2017 21:43:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S969698AbdDSVn0 (ORCPT ); Wed, 19 Apr 2017 17:43:26 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:55485 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969697AbdDSVnY (ORCPT ); Wed, 19 Apr 2017 17:43:24 -0400 Received: from wuerfel.lan ([78.42.17.5]) by mrelayeu.kundenserver.de (mreue001 [212.227.15.129]) with ESMTPA (Nemesis) id 0Mc5lW-1che4q1650-00JKWw; Wed, 19 Apr 2017 23:43:14 +0200 From: Arnd Bergmann To: Tero Kristo , Michael Turquette , Stephen Boyd Cc: Arnd Bergmann , Tony Lindgren , Richard Watts , linux-omap@vger.kernel.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] clk: ti: fix linker error with !SOC_OMAP4 Date: Wed, 19 Apr 2017 23:43:10 +0200 Message-Id: <20170419214318.1605787-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:GIYicUsLEHDwJj1uZirvypJdONlW4bl9yJI8V1Yf2xT9OHWLxch 2CpakZS7dkSlED7TaKeZIsY+05l0Lcijg+sxRqZ4MljL7G7qkvTb/FDYO6LrSdd4eor9P4X D9f3cRe6u5/C529Zihh7MLNJVJNtKgVhpwzpUcQWyVEOPfECaBFaYV/xpJY66KeXF3Lyf7D b7DvDZBRGBNQRQb6VG3ng== X-UI-Out-Filterresults: notjunk:1; V01:K0:U1LTM3TcO8o=:uqSsiKOFP54zIicRcxu0px a/pccPKm8uRtpe2HJItBUI4JDFo9gY4pRBVUBrpIpWNWyuGvlqZ1SsVDGtH7Oj1tamB842Oiz QKdmIqomAOgJrPvw4YUUhLDHoVdfMeG63Scq+5AhH6L6md4+xvb686apMdUAeNu+IcaHVh9X3 MxiiSjEpkkVeN8edNvh1dCWs7Kt172Ruu9NyAPq8lGajh3ZAPiobujAe9Foa5kJhuiDR9SPVa 1LdakIiAsQJe/6HgBkvqKSEDaN0G0mmFFxyKM3VuFGYKMjDHvJolhc5P+OHoiCzTsxwrtejHh Q1h6PUylLwKQfBGDXPBaHejlhu1LA0rmrBltDN1guPcwJuptg1oHmUmJVLRUc5LEJEAgx9qeI OW+ae2IAwGxKJ6rLRW3BEs8zqu3cI93RRo56aoP5fLJHlt8AfWZsDKcZqSidYTEdctZil0kIK dYVT/p+sTG71F7wO/cDkyZea9ngB5bciPEcsexGtnfZgPLdgxi00KsKuvQ6eBhd1Tik7QLoKC EkZsn4W1V2D7HU5NphZCJqtVmhn8b9G4YpQpw0vpMO8UhgIV4c5WJH32EmIrvWrqZ89XXPBKj Qk4/382bFHggvOiLttAv9+MY0y0igdHnj+DrqZfR/NXOqOp15iniL1FsM3J/x7MSuKHV31Fr8 RI+xxZEotUxdHcErxg7M4QInC9n32ZuKpin5Gftton1v4brdThkaKNv9Xv67dFM67gFI= Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Fixes: 0565fb168d63 ("clk: ti: dpll: move omap3 DPLL functionality to clock driver") Signed-off-by: Arnd Bergmann 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);