From: Tony Lindgren Date: Mon, 16 Nov 2020 10:57:13 +0000 (+0200) Subject: ARM: OMAP2+: Check for inited flag X-Git-Tag: accepted/tizen/unified/20230118.172025~8241^2~3^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9261c5b2f51996e7d4e10089f73ea472ae9e996f;p=platform%2Fkernel%2Flinux-rpi.git ARM: OMAP2+: Check for inited flag If we have no hwmods configured and omap_hwmod_init() is not called, we don't want to call omap_hwmod_setup_all() as it will fail with checks for configured MPU at least. Signed-off-by: Tony Lindgren --- diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index 15b29a1..2310cd5 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -627,6 +627,9 @@ static struct clockdomain *_get_clkdm(struct omap_hwmod *oh) { struct clk_hw_omap *clk; + if (!oh) + return NULL; + if (oh->clkdm) { return oh->clkdm; } else if (oh->_clk) { @@ -3677,6 +3680,9 @@ static void __init omap_hwmod_setup_earlycon_flags(void) */ static int __init omap_hwmod_setup_all(void) { + if (!inited) + return 0; + _ensure_mpu_hwmod_is_setup(NULL); omap_hwmod_for_each(_init, NULL);