@@ -786,11 +786,20 @@ static int _init_main_clk(struct omap_hwmod *oh)
if (!oh->main_clk)
return 0;
- oh->_clk = clk_get(NULL, oh->main_clk);
- if (IS_ERR(oh->_clk)) {
- pr_warn("omap_hwmod: %s: cannot clk_get main_clk %s\n",
- oh->name, oh->main_clk);
- return -EINVAL;
+ if (of_have_populated_dt()) {
+ struct of_phandle_args clkspec;
+
+ clkspec.np = of_find_node_by_name(NULL, oh->main_clk);
+ oh->_clk = of_clk_get_from_provider(&clkspec);
+ }
+
+ if (!oh->_clk) {
+ oh->_clk = clk_get(NULL, oh->main_clk);
+ if (IS_ERR(oh->_clk)) {
+ pr_warn("omap_hwmod: %s: cannot clk_get main_clk %s\n",
+ oh->name, oh->main_clk);
+ return -EINVAL;
+ }
}
/*
* HACK: This needs a re-visit once clk_prepare() is implemented
This avoids the need to add clock aliases under drivers/clk/ti/clk-xyz.c files. Signed-off-by: Tero Kristo <t-kristo@ti.com> --- arch/arm/mach-omap2/omap_hwmod.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html