Skip to content

Commit

Permalink
mfd: vexpress: Allow vexpress-sysreg to self-initialise
Browse files Browse the repository at this point in the history
The vexpress_sysreg_init() is a core_initcall() already and it can
trigger the early initialisation if a matching node is found. This patch
allows the SoC code to avoid calling vexpress_sysreg_of_early_init()
explicitly.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
  • Loading branch information
Catalin Marinas authored and Samuel Ortiz committed Feb 13, 2013
1 parent e123793 commit dcd560c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/mfd/vexpress-sysreg.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,14 +338,15 @@ void __init vexpress_sysreg_early_init(void __iomem *base)

void __init vexpress_sysreg_of_early_init(void)
{
struct device_node *node = of_find_compatible_node(NULL, NULL,
"arm,vexpress-sysreg");
struct device_node *node;

if (vexpress_sysreg_base)
return;

node = of_find_compatible_node(NULL, NULL, "arm,vexpress-sysreg");
if (node) {
vexpress_sysreg_base = of_iomap(node, 0);
vexpress_sysreg_setup(node);
} else {
pr_info("vexpress-sysreg: No Device Tree node found.");
}
}

Expand Down Expand Up @@ -515,6 +516,7 @@ static struct platform_driver vexpress_sysreg_driver = {

static int __init vexpress_sysreg_init(void)
{
vexpress_sysreg_of_early_init();
return platform_driver_register(&vexpress_sysreg_driver);
}
core_initcall(vexpress_sysreg_init);

0 comments on commit dcd560c

Please sign in to comment.