From: Arnd Bergmann <arnd@arndb.de>
To: Tero Kristo <t-kristo@ti.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@codeaurora.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Tony Lindgren <tony@atomide.com>,
Richard Watts <rrw@kynesim.co.uk>,
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 [thread overview]
Message-ID: <20170419214318.1605787-1-arnd@arndb.de> (raw)
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 <arnd@arndb.de>
---
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);
--
2.9.0
next reply other threads:[~2017-04-19 21:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 21:43 Arnd Bergmann [this message]
2017-04-20 14:57 ` [PATCH] clk: ti: fix linker error with !SOC_OMAP4 Tero Kristo
2017-04-20 15:06 ` Arnd Bergmann
2017-04-20 15:13 ` Tero Kristo
2017-04-22 1:54 ` Stephen Boyd
2017-04-22 1:56 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170419214318.1605787-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=rrw@kynesim.co.uk \
--cc=sboyd@codeaurora.org \
--cc=t-kristo@ti.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox