clk: sifive: Allow building the driver as a module
authorSamuel Holland <samuel.holland@sifive.com>
Tue, 25 Jul 2023 00:42:48 +0000 (17:42 -0700)
committerStephen Boyd <sboyd@kernel.org>
Tue, 24 Oct 2023 03:27:46 +0000 (20:27 -0700)
This can reduce the kernel image size in multiplatform configurations.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Link: https://lore.kernel.org/r/20230725004248.381868-2-samuel.holland@sifive.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/sifive/Kconfig
drivers/clk/sifive/sifive-prci.c

index 2322f634a910e9da09f3e4082d0c7c497158ea03..49597d95602eb068d3fcf2f8941da1e72129ff70 100644 (file)
@@ -10,7 +10,7 @@ menuconfig CLK_SIFIVE
 if CLK_SIFIVE
 
 config CLK_SIFIVE_PRCI
-       bool "PRCI driver for SiFive SoCs"
+       tristate "PRCI driver for SiFive SoCs"
        default ARCH_SIFIVE
        select RESET_CONTROLLER
        select RESET_SIMPLE
index af81eb835bc235ab66f1be1fc43a61c62cd6383f..25b8e1a80ddce0bf0f88428ea79d2ec45b11e1e2 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/clkdev.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/module.h>
 #include <linux/of.h>
 #include "sifive-prci.h"
 #include "fu540-prci.h"
@@ -618,9 +619,8 @@ static struct platform_driver sifive_prci_driver = {
        },
        .probe = sifive_prci_probe,
 };
+module_platform_driver(sifive_prci_driver);
 
-static int __init sifive_prci_init(void)
-{
-       return platform_driver_register(&sifive_prci_driver);
-}
-core_initcall(sifive_prci_init);
+MODULE_AUTHOR("Paul Walmsley <paul.walmsley@sifive.com>");
+MODULE_DESCRIPTION("SiFive Power Reset Clock Interface (PRCI) driver");
+MODULE_LICENSE("GPL");