]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
OMAP: HWMOD: Adding clockdomain check
authorThara Gopinath <thara@ti.com>
Wed, 31 Mar 2010 10:16:29 +0000 (04:16 -0600)
committerPaul Walmsley <paul@pwsan.com>
Wed, 31 Mar 2010 10:16:29 +0000 (04:16 -0600)
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 <thara@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/omap_hwmod.c

index c6649472ce0d1d74f4a3e02bd7f0d6d83acf5e22..e436dcb19795cd259f91faaad864adfe558705d2 100644 (file)
@@ -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;
 
 }