You should construct a self-contained kernel module which initializes its own data structure pointers when it is loaded, and tears them all down correctly when it is unloaded ... with all of the necessary protocols to ensure that this takes place correctly on an incredibly-busy multi-CPU system.
Your kernel module should contain whatever APIs are necessary to access the
functionality of whatever-it-is you are doing, from user-space. Nothing else in the kernel should know or care.
Treat the main-line kernel source files as
sacrosanct, reserved only for the
gods. Let this Eleventh Commandment be carved upon your door ... or upon your brow ... "Thou Shalt Not Touch."
(In all seriousness, "you could
up a lot of things." Go find the existing kernel module that is most similar to what you are already doing, and
hack it into something else very carefully base your own efforts upon its precedents. It's a time-honored tradition to do that.)