I have programmed a simple module that can be loaded into the kernel to control a simple led. It works fine. The source files are two C files and one header file:
gpio_handler_ws.c nct5104d_access.c nct5104d_access.h
I decided to add it to kernel sources doing these steps:
1. In drivers/char modify the Kconfig file adding:
config GPIO0_DEVICE
tristate "GPIO0 device"
default y
help
"Creates /dev/wsgpio0 char device to control GPIO0"
2. In drivers/char modify the Makefile file adding:
obj-$(CONFIG_GPIO0_DEVICE) += wsgpio_udev.o
wsgpio_udev-objs := gpio_handler_ws.o nct5104d_access.o
3. Copy source and headers files to drivers/char directory
Then, if I select the m option in menuconfig to compile it as a module, it creates the wsgpio_udev.ko file that works as expected, I can load it and it creates de /dev/wsgpio0 device that controls the LED.
BUT if I select the built-in option it compiles and generates the wsgpio_udev.o file but after rebooting with the new kernel no /dev/wsgpio0 device is created. As far as I know, the built-in modules are listed in /lib/modules/$(uname -r)/modules.builtin but I don't see wsgpio_udev.ko there
Am I missing something?