Skip to content

Commit

Permalink
clk: nomadik: fix multiplatform problem
Browse files Browse the repository at this point in the history
The Nomadik debugfs screws up multiplatform boots if debugfs
is enabled on the multiplatform image, since it's a simple
initcall that is unconditionally executed and reads from certain
memory locations.

Fix this by checking that the driver has been properly
initialized, so a base offset to the Nomadik SRC controller
exists, before proceeding to register debugfs files.

Reported-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
  • Loading branch information
Linus Walleij authored and Mike Turquette committed Feb 26, 2014
1 parent 10b7cdc commit ec6deea
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/clk/clk-nomadik.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ static const struct file_operations nomadik_src_clk_debugfs_ops = {

static int __init nomadik_src_clk_init_debugfs(void)
{
/* Vital for multiplatform */
if (!src_base)
return -ENODEV;
src_pcksr0_boot = readl(src_base + SRC_PCKSR0);
src_pcksr1_boot = readl(src_base + SRC_PCKSR1);
debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,
Expand Down

0 comments on commit ec6deea

Please sign in to comment.