Skip to contentSkip to conversation

cxl: make base more explicitly non-modular

PATCH Applied Paul Gortmaker 3 participants 3 messages Jul 3, 2016 – Jul 11, 2016 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl: make base more explicitly non-modular

The Kconfig/Makefile currently controlling compilation of this code is:

drivers/misc/cxl/Kconfig:config CXL_BASE
drivers/misc/cxl/Kconfig: bool

drivers/misc/cxl/Makefile:obj-$(CONFIG_CXL_BASE) += base.o

...meaning that it currently is not being built as a module by anyone.

Lets convert the one module_init into device_initcall so that when reading the driver it more clear that it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

We don't replace module.h with init.h since the file is doing other modular stuff (module_get/put) even though it is built-in.

---
 drivers/misc/cxl/base.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/cxl/base.c +1 -2
index 9b90ec6c07cd..e6f49aca0035 100644
@@ -114,5 +114,4 @@ static int __init cxl_base_init(void)
 	pr_devel("Found %d cxl device(s)\n", count);
 	return 0;
 }
-
-module_init(cxl_base_init);
+device_initcall(cxl_base_init);
Signature · 1 line
2.8.4
#2 lore raw
In reply to Paul Gortmaker
Quoted 15 lines · Paul Gortmaker

The Kconfig/Makefile currently controlling compilation of this code is:

drivers/misc/cxl/Kconfig:config CXL_BASE
drivers/misc/cxl/Kconfig: bool

drivers/misc/cxl/Makefile:obj-$(CONFIG_CXL_BASE) += base.o

...meaning that it currently is not being built as a module by anyone.

Lets convert the one module_init into device_initcall so that when reading the driver it more clear that it is builtin-only.

Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit.

Quoted 8 lines

We don't replace module.h with init.h since the file is doing other modular stuff (module_get/put) even though it is built-in.

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/e00878be3f414a99234b3c9613

cheers