Re: Module complexities

Theodore Ts'o (tytso@mit.edu)
Thu, 21 Mar 1996 14:57:43 -0500


It gets even more complicated if you need to support 1.2 kernels, which
those of us who are providing drivers for the Real World have to do....

This is what I do to make the Comtrol driver work under 1.2.x and
1.3.recent kernels. I don't think it works on pre-1.3.39 kernels;
supporting that would probably add even more complexity!

- Ted

#include <linux/version.h>

#if (LINUX_VERSION_CODE > 66304)
#define NEW_MODULES
#define MODULE
#endif

#ifdef NEW_MODULES
#ifdef MODVERSIONS
#include <linux/modversions.h>
#endif
#include <linux/module.h>
#include <linux/config.h>
#else
#include <linux/config.h>
#include <linux/module.h>
#endif