From 588f2de8816696465c3481d7ac196c7ccdb472b0 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 13 Jul 2000 01:29:23 +0000 Subject: [PATCH] added module stuff for 2.0 --- comedi/kern_compat.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/comedi/kern_compat.h b/comedi/kern_compat.h index d05b71b5..36482194 100644 --- a/comedi/kern_compat.h +++ b/comedi/kern_compat.h @@ -209,10 +209,20 @@ typedef struct wait_queue *wait_queue_head_t; #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) /* ? */ -#ifdef MODULE -#define THIS_MODULE &__this_module +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) + #ifdef MODULE + /* don't ask. It works. */ + #define THIS_MODULE ((struct module *)&mod_use_count_) + #else + #define THIS_MODULE NULL + #endif + #define __MOD_INC_USE_COUNT(x) ((*(long *)(x))++, (*(long *)(x)) |= MOD_VISITED) + #define __MOD_DEC_USE_COUNT(x) ((*(long *)(x))--, (*(long *)(x)) |= MOD_VISITED) #else -#define THIS_MODULE NULL + #ifdef MODULE + #define THIS_MODULE &__this_module + #else + #define THIS_MODULE NULL #endif #endif -- 2.26.2