Commit 7b9d428e authored by Rob Herring's avatar Rob Herring

mfd: vexpress-sysreg: Support building as a module

Enable building the vexpress-sysreg driver as a module.

As deferred probe between the vexpress components works now, we don't
need to create struct devices early with of_platform_device_create().

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Acked-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarRob Herring <robh@kernel.org>
parent 0ea355ef
...@@ -2028,7 +2028,7 @@ config MCP_UCB1200_TS ...@@ -2028,7 +2028,7 @@ config MCP_UCB1200_TS
endmenu endmenu
config MFD_VEXPRESS_SYSREG config MFD_VEXPRESS_SYSREG
bool "Versatile Express System Registers" tristate "Versatile Express System Registers"
depends on VEXPRESS_CONFIG && GPIOLIB depends on VEXPRESS_CONFIG && GPIOLIB
default y default y
select GPIO_GENERIC_PLATFORM select GPIO_GENERIC_PLATFORM
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/mfd/core.h> #include <linux/mfd/core.h>
#include <linux/module.h>
#include <linux/of_platform.h> #include <linux/of_platform.h>
#include <linux/platform_data/syscon.h> #include <linux/platform_data/syscon.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -151,6 +152,7 @@ static const struct of_device_id vexpress_sysreg_match[] = { ...@@ -151,6 +152,7 @@ static const struct of_device_id vexpress_sysreg_match[] = {
{ .compatible = "arm,vexpress-sysreg", }, { .compatible = "arm,vexpress-sysreg", },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, vexpress_sysreg_match);
static struct platform_driver vexpress_sysreg_driver = { static struct platform_driver vexpress_sysreg_driver = {
.driver = { .driver = {
...@@ -160,14 +162,5 @@ static struct platform_driver vexpress_sysreg_driver = { ...@@ -160,14 +162,5 @@ static struct platform_driver vexpress_sysreg_driver = {
.probe = vexpress_sysreg_probe, .probe = vexpress_sysreg_probe,
}; };
static int __init vexpress_sysreg_init(void) module_platform_driver(vexpress_sysreg_driver);
{ MODULE_LICENSE("GPL v2");
struct device_node *node;
/* Need the sysreg early, before any other device... */
for_each_matching_node(node, vexpress_sysreg_match)
of_platform_device_create(node, NULL, NULL);
return platform_driver_register(&vexpress_sysreg_driver);
}
core_initcall(vexpress_sysreg_init);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment