]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ARM: OMAP: hwmod: fix an incorrect clk type cast with _get_clkdm
authorTero Kristo <t-kristo@ti.com>
Fri, 12 Jul 2013 09:26:41 +0000 (12:26 +0300)
committerMike Turquette <mturquette@linaro.org>
Fri, 17 Jan 2014 20:37:03 +0000 (12:37 -0800)
If the main clock for a hwmod is of basic clock type, it is illegal to type
cast this to clk_hw_omap and will result in bogus data. Fixed by checking
the clock flags before attempting the type cast.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
arch/arm/mach-omap2/omap_hwmod.c

index 8a1b5e0bad40df2adbab8b202e0dd87602fe7921..cc24c95b77e50ea882cd260b14cf688dc03b952e 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;
        }