From: Thara Gopinath Date: Wed, 31 Mar 2010 10:16:29 +0000 (-0600) Subject: OMAP: HWMOD: Adding clockdomain check X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d5647c18eac9a313a89a3049a9fff51b20021a44;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git OMAP: HWMOD: Adding clockdomain check This patch adds check for presence of clockdomain structure in the API omap_hwmod_get_pwrdm before trying to access the powerdomain structure. This will prevent unnecessary crashing of the system in case of a clock node with out an associated clockdomain. Signed-off-by: Thara Gopinath Signed-off-by: Paul Walmsley --- diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c index c6649472ce0d..e436dcb19795 100644 --- a/arch/arm/mach-omap2/omap_hwmod.c +++ b/arch/arm/mach-omap2/omap_hwmod.c @@ -1511,6 +1511,9 @@ struct powerdomain *omap_hwmod_get_pwrdm(struct omap_hwmod *oh) c = oh->slaves[oh->_mpu_port_index]->_clk; } + if (!c->clkdm) + return NULL; + return c->clkdm->pwrdm.ptr; }