Merge tag 'clk-for-linus-3.14-part2' of git://git.linaro.org/people/mike.turquette...
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-omap2 / omap_hwmod.c
index 8a1b5e0bad40df2adbab8b202e0dd87602fe7921..42d81885c700c498babd2dd2e5d322e3af2c3f19 100644 (file)
@@ -686,6 +686,8 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh)
        if (oh->clkdm) {
                return oh->clkdm;
        } else if (oh->_clk) {
+               if (__clk_get_flags(oh->_clk) & CLK_IS_BASIC)
+                       return NULL;
                clk = to_clk_hw_omap(__clk_get_hw(oh->_clk));
                return  clk->clkdm;
        }
@@ -1576,7 +1578,7 @@ static int _init_clkdm(struct omap_hwmod *oh)
        if (!oh->clkdm) {
                pr_warning("omap_hwmod: %s: could not associate to clkdm %s\n",
                        oh->name, oh->clkdm_name);
-               return -EINVAL;
+               return 0;
        }
 
        pr_debug("omap_hwmod: %s: associated to clkdm %s\n",
@@ -2791,9 +2793,7 @@ static int __init _alloc_links(struct omap_hwmod_link **ml,
        sz = sizeof(struct omap_hwmod_link) * LINKS_PER_OCP_IF;
 
        *sl = NULL;
-       *ml = alloc_bootmem(sz);
-
-       memset(*ml, 0, sz);
+       *ml = memblock_virt_alloc(sz, 0);
 
        *sl = (void *)(*ml) + sizeof(struct omap_hwmod_link);
 
@@ -2912,9 +2912,7 @@ static int __init _alloc_linkspace(struct omap_hwmod_ocp_if **ois)
        pr_debug("omap_hwmod: %s: allocating %d byte linkspace (%d links)\n",
                 __func__, sz, max_ls);
 
-       linkspace = alloc_bootmem(sz);
-
-       memset(linkspace, 0, sz);
+       linkspace = memblock_virt_alloc(sz, 0);
 
        return 0;
 }
@@ -4235,6 +4233,7 @@ void __init omap_hwmod_init(void)
                soc_ops.assert_hardreset = _omap2_assert_hardreset;
                soc_ops.deassert_hardreset = _omap2_deassert_hardreset;
                soc_ops.is_hardreset_asserted = _omap2_is_hardreset_asserted;
+               soc_ops.init_clkdm = _init_clkdm;
        } else if (cpu_is_omap44xx() || soc_is_omap54xx() || soc_is_dra7xx()) {
                soc_ops.enable_module = _omap4_enable_module;
                soc_ops.disable_module = _omap4_disable_module;