Skip to contentSkip to conversation

reset: berlin: support module build

PATCH Applied Jisheng Zhang 2 participants 2 messages Jun 7, 2021 Reset controller framework

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 reset: berlin: support module build

Make reset-berlin driver to be tristate module, support to build as a module, this is useful for GKI.

Partially reverts commit ed4dba99cae8 ("reset: berlin: make it explicitly non-modular")

---
Since v1:
- Add default m if ARCH_BERLIN per Philipp's suggestion

 drivers/reset/Kconfig        |  5 +++--
 drivers/reset/reset-berlin.c | 10 ++++++++--
 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/reset/Kconfig +3 -2
index 3e7f55e44d84..4d64f5cc1677 100644
@@ -43,8 +43,9 @@ config RESET_BCM6345
 	  This enables the reset controller driver for BCM6345 SoCs.
 
 config RESET_BERLIN
-	bool "Berlin Reset Driver" if COMPILE_TEST
-	default ARCH_BERLIN
+	tristate "Berlin Reset Driver"
+	depends on ARCH_BERLIN || COMPILE_TEST
+	default m if ARCH_BERLIN
 	help
 	  This enables the reset controller driver for Marvell Berlin SoCs.
 
drivers/reset/reset-berlin.c +8 -2
index 371197bbd055..72d8ea554d5f 100644
@@ -14,7 +14,7 @@
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
-#include <linux/init.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/platform_device.h>
@@ -93,6 +93,7 @@ static const struct of_device_id berlin_reset_dt_match[] = {
 	{ .compatible = "marvell,berlin2-reset" },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, berlin_reset_dt_match);
 
 static struct platform_driver berlin_reset_driver = {
 	.probe	= berlin2_reset_probe,
@@ -101,4 +102,9 @@ static struct platform_driver berlin_reset_driver = {
 		.of_match_table = berlin_reset_dt_match,
 	},
 };
-builtin_platform_driver(berlin_reset_driver);
+module_platform_driver(berlin_reset_driver);
+
+MODULE_AUTHOR("Antoine Tenart <[email protected]>");
+MODULE_AUTHOR("Sebastian Hesselbarth <[email protected]>");
+MODULE_DESCRIPTION("Synaptics Berlin reset controller");
+MODULE_LICENSE("GPL");
Signature · 1 line
2.31.0
maintainer Applied
#1 lore raw
Quoted 10 lines · Jisheng Zhang

Make reset-berlin driver to be tristate module, support to build as a module, this is useful for GKI.

Partially reverts commit ed4dba99cae8 ("reset: berlin: make it explicitly non-modular")

---
Since v1:
- Add default m if ARCH_BERLIN per Philipp's suggestion

Thank you, applied to reset/next.

regards
Philipp