Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: nomadik: fix multiplatform problem

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>

authored by

Linus Walleij and committed by
Mike Turquette
ec6deea1 10b7cdc0

+3
+3
drivers/clk/clk-nomadik.c
··· 494 494 495 495 static int __init nomadik_src_clk_init_debugfs(void) 496 496 { 497 + /* Vital for multiplatform */ 498 + if (!src_base) 499 + return -ENODEV; 497 500 src_pcksr0_boot = readl(src_base + SRC_PCKSR0); 498 501 src_pcksr1_boot = readl(src_base + SRC_PCKSR1); 499 502 debugfs_create_file("nomadik-src-clk", S_IFREG | S_IRUGO,