[PATCH v3 3/7] vexpress: Allow vexpress-sysreg to self-initialise
Catalin Marinas
catalin.marinas at arm.com
Fri Jan 4 09:17:17 EST 2013
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 at arm.com>
Cc: Pawel Moll <pawel.moll at arm.com>
---
drivers/mfd/vexpress-sysreg.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/vexpress-sysreg.c b/drivers/mfd/vexpress-sysreg.c
index 733c06b..ff5d16c 100644
--- a/drivers/mfd/vexpress-sysreg.c
+++ b/drivers/mfd/vexpress-sysreg.c
@@ -318,8 +318,9 @@ void __init vexpress_sysreg_early_init(void __iomem *base)
struct device_node *node = of_find_compatible_node(NULL, NULL,
"arm,vexpress-sysreg");
- if (node)
- base = of_iomap(node, 0);
+ if (!node)
+ return;
+ base = of_iomap(node, 0);
if (WARN_ON(!base))
return;
@@ -338,6 +339,8 @@ void __init vexpress_sysreg_early_init(void __iomem *base)
void __init vexpress_sysreg_of_early_init(void)
{
+ if (vexpress_sysreg_base)
+ return;
vexpress_sysreg_early_init(NULL);
}
@@ -470,6 +473,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);
More information about the linux-arm-kernel
mailing list