Having trouble writing a kernel module



I'm trying to write an API as a kernel module and hope to be able to call functions from my module in device drivers. These are the steps I have followed. Am I missing anything?

1.) Write module with some functions (code.h and code.c).
2.) Build module, load with insmod.
3.) Copy code.h into <kernel>/include/linux directory.
4.) #include <linux/code.h> in a driver.
5.) Add a call to a function from my API in the driver.
6.) Build the driver, load with insmod.

But this isn't working. When I try to build the driver, I get warnings saying that the API functions are undefined. Any idea what's going on?

Members online