diff mbox series

[16/17] bus: vexpress-config: Support building as module

Message ID 20200419170810.5738-17-robh@kernel.org (mailing list archive)
State New, archived
Headers show
Series Modularizing Versatile Express | expand

Commit Message

Rob Herring (Arm) April 19, 2020, 5:08 p.m. UTC
Enable building vexpress-config driver as a module.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/bus/Kconfig           |  2 +-
 drivers/bus/vexpress-config.c | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

Comments

Liviu Dudau April 22, 2020, 12:04 p.m. UTC | #1
On Sun, Apr 19, 2020 at 12:08:09PM -0500, Rob Herring wrote:
> Enable building vexpress-config driver as a module.
> 
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

> Cc: Sudeep Holla <sudeep.holla@arm.com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/bus/Kconfig           |  2 +-
>  drivers/bus/vexpress-config.c | 10 ++++------
>  2 files changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
> index 6d4e4497b59b..c16268c53831 100644
> --- a/drivers/bus/Kconfig
> +++ b/drivers/bus/Kconfig
> @@ -183,7 +183,7 @@ config UNIPHIER_SYSTEM_BUS
>  	  needed to use on-board devices connected to UniPhier SoCs.
>  
>  config VEXPRESS_CONFIG
> -	bool "Versatile Express configuration bus"
> +	tristate "Versatile Express configuration bus"
>  	default y if ARCH_VEXPRESS
>  	depends on ARM || ARM64
>  	depends on OF
> diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
> index caa35a4cb34d..a58ac0c8e282 100644
> --- a/drivers/bus/vexpress-config.c
> +++ b/drivers/bus/vexpress-config.c
> @@ -7,6 +7,7 @@
>  #include <linux/err.h>
>  #include <linux/init.h>
>  #include <linux/io.h>
> +#include <linux/module.h>
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/of_device.h>
> @@ -407,15 +408,12 @@ static const struct platform_device_id vexpress_syscfg_id_table[] = {
>  	{ "vexpress-syscfg", },
>  	{},
>  };
> +MODULE_DEVICE_TABLE(platform, vexpress_syscfg_id_table);
>  
>  static struct platform_driver vexpress_syscfg_driver = {
>  	.driver.name = "vexpress-syscfg",
>  	.id_table = vexpress_syscfg_id_table,
>  	.probe = vexpress_syscfg_probe,
>  };
> -
> -static int __init vexpress_syscfg_init(void)
> -{
> -	return platform_driver_register(&vexpress_syscfg_driver);
> -}
> -core_initcall(vexpress_syscfg_init);
> +module_platform_driver(vexpress_syscfg_driver);
> +MODULE_LICENSE("GPL v2");
> -- 
> 2.20.1
>
diff mbox series

Patch

diff --git a/drivers/bus/Kconfig b/drivers/bus/Kconfig
index 6d4e4497b59b..c16268c53831 100644
--- a/drivers/bus/Kconfig
+++ b/drivers/bus/Kconfig
@@ -183,7 +183,7 @@  config UNIPHIER_SYSTEM_BUS
 	  needed to use on-board devices connected to UniPhier SoCs.
 
 config VEXPRESS_CONFIG
-	bool "Versatile Express configuration bus"
+	tristate "Versatile Express configuration bus"
 	default y if ARCH_VEXPRESS
 	depends on ARM || ARM64
 	depends on OF
diff --git a/drivers/bus/vexpress-config.c b/drivers/bus/vexpress-config.c
index caa35a4cb34d..a58ac0c8e282 100644
--- a/drivers/bus/vexpress-config.c
+++ b/drivers/bus/vexpress-config.c
@@ -7,6 +7,7 @@ 
 #include <linux/err.h>
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/of_device.h>
@@ -407,15 +408,12 @@  static const struct platform_device_id vexpress_syscfg_id_table[] = {
 	{ "vexpress-syscfg", },
 	{},
 };
+MODULE_DEVICE_TABLE(platform, vexpress_syscfg_id_table);
 
 static struct platform_driver vexpress_syscfg_driver = {
 	.driver.name = "vexpress-syscfg",
 	.id_table = vexpress_syscfg_id_table,
 	.probe = vexpress_syscfg_probe,
 };
-
-static int __init vexpress_syscfg_init(void)
-{
-	return platform_driver_register(&vexpress_syscfg_driver);
-}
-core_initcall(vexpress_syscfg_init);
+module_platform_driver(vexpress_syscfg_driver);
+MODULE_LICENSE("GPL v2");