diff --git a/kernel/include/compat.h b/kernel/include/compat.h index c9569908..3521d902 100644 --- a/kernel/include/compat.h +++ b/kernel/include/compat.h @@ -43,6 +43,9 @@ #define MODULE_PARM_DESC(no,description) #endif #endif /* def MODULE */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,13) +#define THIS_MODULE NULL +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) #define EXPORT_SYMBOL(noexport) diff --git a/mkpatch/mkpatch.pl b/mkpatch/mkpatch.pl index 3cf4f47d..1e3a4fbf 100755 --- a/mkpatch/mkpatch.pl +++ b/mkpatch/mkpatch.pl @@ -740,6 +740,15 @@ sub main EOF + if (`grep THIS_MODULE "$package_root/$package_file"`) { + print OUTPUT << 'EOF'; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,13) +/* This is safe, because we won't use it for any kernels below 2.3.27 */ +#define THIS_MODULE NULL +#endif + +EOF + } if (`grep KERNEL_VERSION "$package_root/$package_file"`) { print OUTPUT << 'EOF'; #include