aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2021-11-18 21:33:35 -0600
committerMaxime Ripard <maxime@cerno.tech>2021-11-22 10:02:21 +0100
commitc8c525b06f532923d21d99811a7b80bf18ffd2be (patch)
treecc3d2287aa0795f64f06b7ce501c086cc5313d09 /drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
parentclk: sunxi-ng: Export symbols used by CCU drivers (diff)
downloadlinux-dev-c8c525b06f532923d21d99811a7b80bf18ffd2be.tar.xz
linux-dev-c8c525b06f532923d21d99811a7b80bf18ffd2be.zip
clk: sunxi-ng: Allow drivers to be built as modules
While it is useful to build all of the CCU drivers at once, only 1-3 of them will be loaded at a time, or possibly none of them if the kernel is booted on a non-sunxi platform. These CCU drivers are relatively large; 32-bit drivers have 30-50k of data each, while the 64-bit ones are 50-75k due to the increased pointer overhead. About half of that data comes from relocations. Let's allow the user to build these drivers as modules so only the necessary data is loaded. As a first step, convert the CCUs that are already platform drivers. When the drivers are built as modules, normally the file name becomes the module name. However, the current file names are inconsistent with the <platform>-<peripheral> name used everywhere else: the devicetree bindings, the platform driver names, and the Kconfig symbols. Use Makfile logic to rename the modules so they follow the usual pattern. Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20211119033338.25486-3-samuel@sholland.org
Diffstat (limited to 'drivers/clk/sunxi-ng/ccu-sun8i-a83t.c')
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-a83t.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c b/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
index 3c310aea8cfa..76cbd9e9e89f 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
@@ -5,7 +5,7 @@
#include <linux/clk-provider.h>
#include <linux/io.h>
-#include <linux/of_address.h>
+#include <linux/module.h>
#include <linux/platform_device.h>
#include "ccu_common.h"
@@ -920,4 +920,7 @@ static struct platform_driver sun8i_a83t_ccu_driver = {
.of_match_table = sun8i_a83t_ccu_ids,
},
};
-builtin_platform_driver(sun8i_a83t_ccu_driver);
+module_platform_driver(sun8i_a83t_ccu_driver);
+
+MODULE_IMPORT_NS(SUNXI_CCU);
+MODULE_LICENSE("GPL");