aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2015-01-14 17:37:15 -0800
committerTony Lindgren <tony@atomide.com>2015-01-14 17:37:15 -0800
commit339d095ab23cf5de223c9633ee4d3ec1794282af (patch)
treee2d16c0a98b3d55106b42185d16c2769e81c78a8 /arch/arm/mach-omap2/clock.c
parentLinux 3.19-rc1 (diff)
downloadlinux-dev-339d095ab23cf5de223c9633ee4d3ec1794282af.tar.xz
linux-dev-339d095ab23cf5de223c9633ee4d3ec1794282af.zip
ARM: OMAP2+: Fix error handling for omap2_clk_enable_init_clocks
We need to check if we got the clock before trying to do anything with it. Otherwise we will get something like this: Unable to handle kernel paging request at virtual address fffffffe ... [<c04bef78>] (clk_prepare) from [<c00338a4>] (omap2_clk_enable_init_clocks+0x50/0x8) [<c00338a4>] (omap2_clk_enable_init_clocks) from [<c0876838>] (dm816x_dt_clk_init+0) ... Let's add check for the clock and WARN if the init clock was not found. Cc: Brian Hutchinson <b.hutchman@gmail.com> Cc: Paul Walmsley <paul@pwsan.com> Cc: Tero Kristo <t-kristo@ti.com> Reviewed-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r--arch/arm/mach-omap2/clock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 6ad5b4dbd33e..4ae4ccebced2 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -620,6 +620,9 @@ void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks)
for (i = 0; i < num_clocks; i++) {
init_clk = clk_get(NULL, clk_names[i]);
+ if (WARN(IS_ERR(init_clk), "could not find init clock %s\n",
+ clk_names[i]))
+ continue;
clk_prepare_enable(init_clk);
}
}