Subject: [PATCH 04/17] power/reset: vexpress: Support building as a module

From: Rob Herring <[email-masked]>
Date: Sun, 19 Apr 2020 12:07:57 -0500

Enable building the VExpress power-off/reset driver as a module.

Cc: Catalin Marinas <[email-masked]>
Cc: Will Deacon <[email-masked]>
Cc: Liviu Dudau <[email-masked]>
Cc: Sudeep Holla <[email-masked]>
Cc: Lorenzo Pieralisi <[email-masked]>
Cc: Linus Walleij <[email-masked]>
Cc: Sebastian Reichel <[email-masked]>
Cc: [email-masked]
Signed-off-by: Rob Herring <[email-masked]>
---
 drivers/power/reset/Kconfig             |  2 +-
 drivers/power/reset/vexpress-poweroff.c | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/power/reset/Kconfig b/drivers/power/reset/Kconfig
index 890380302080..0ba18221ba40 100644
--- a/drivers/power/reset/Kconfig
+++ b/drivers/power/reset/Kconfig
@@ -182,7 +182,7 @@ config POWER_RESET_VERSATILE
 	  reference boards.
 
 config POWER_RESET_VEXPRESS
-	bool "ARM Versatile Express power-off and reset driver"
+	tristate "ARM Versatile Express power-off and reset driver"
 	depends on ARM || ARM64
 	depends on VEXPRESS_CONFIG
 	help
diff --git a/drivers/power/reset/vexpress-poweroff.c b/drivers/power/reset/vexpress-poweroff.c
index 90cbaa8341e3..8a6d3add894c 100644
--- a/drivers/power/reset/vexpress-poweroff.c
+++ b/drivers/power/reset/vexpress-poweroff.c
@@ -5,6 +5,7 @@
  */
 
 #include <linux/delay.h>
+#include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
@@ -87,6 +88,7 @@ static const struct of_device_id vexpress_reset_of_match[] = {
 	},
 	{}
 };
+MODULE_DEVICE_TABLE(of, vexpress_reset_of_match);
 
 static int _vexpress_register_restart_handler(struct device *dev)
 {
@@ -145,9 +147,5 @@ static struct platform_driver vexpress_reset_driver = {
 		.of_match_table = vexpress_reset_of_match,
 	},
 };
-
-static int __init vexpress_reset_init(void)
-{
-	return platform_driver_register(&vexpress_reset_driver);
-}
-device_initcall(vexpress_reset_init);
+module_platform_driver(vexpress_reset_driver);
+MODULE_LICENSE("GPL v2");
-- 
2.20.1

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel