From aa0c8f676813fe6b52833a19fe438d1166141562 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Wed, 22 Nov 2000 23:54:39 +0000 Subject: [PATCH] Updated the MUTEX definitions again - they are now guarded by the horrible #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) They should now both work with 2.3 kernels (including 2.4 prepatches) and very new 2.2 kernels (ie. 2.2.18 prepatches) git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@933 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 2 +- kernel/chips/adm1021.c | 3 ++- kernel/chips/adm1025.c | 3 ++- kernel/chips/adm9240.c | 3 ++- kernel/chips/bt869.c | 3 ++- kernel/chips/ddcmon.c | 3 ++- kernel/chips/eeprom.c | 3 ++- kernel/chips/gl518sm.c | 3 ++- kernel/chips/gl520sm.c | 3 ++- kernel/chips/icspll.c | 3 ++- kernel/chips/lm75.c | 3 ++- kernel/chips/lm78.c | 3 ++- kernel/chips/lm80.c | 3 ++- kernel/chips/lm87.c | 3 ++- kernel/chips/ltc1710.c | 3 ++- kernel/chips/matorb.c | 3 ++- kernel/chips/maxilife.c | 3 ++- kernel/chips/mtp008.c | 3 ++- kernel/chips/pcf8574.c | 3 ++- kernel/chips/sis5595.c | 3 ++- kernel/chips/thmc50.c | 3 ++- kernel/chips/via686a.c | 3 ++- kernel/chips/w83781d.c | 3 ++- 23 files changed, 45 insertions(+), 23 deletions(-) diff --git a/CHANGES b/CHANGES index 4d35340f..1e0e2e8a 100644 --- a/CHANGES +++ b/CHANGES @@ -18,7 +18,7 @@ ask CVS about it: ----------------------------------------------------------------------------- 2.5.5 (2000????) - Chip modules (all): Update mutex + Chip modules (all): Update mutex definition (works now for new 2.2 kernels) File sensors.conf.eg: Add mtp008 entries Library: Add mtp008 support Module adm1021: Add support for adm1021a / adm1023 diff --git a/kernel/chips/adm1021.c b/kernel/chips/adm1021.c index 02fbe355..64133579 100644 --- a/kernel/chips/adm1021.c +++ b/kernel/chips/adm1021.c @@ -29,7 +29,8 @@ #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/adm1025.c b/kernel/chips/adm1025.c index f8681086..5941f9f5 100644 --- a/kernel/chips/adm1025.c +++ b/kernel/chips/adm1025.c @@ -38,7 +38,8 @@ #include "sensors.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/adm9240.c b/kernel/chips/adm9240.c index 4621dfc9..27d075e6 100644 --- a/kernel/chips/adm9240.c +++ b/kernel/chips/adm9240.c @@ -63,7 +63,8 @@ #include "sensors.h" #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/bt869.c b/kernel/chips/bt869.c index e1547b74..e52021fb 100644 --- a/kernel/chips/bt869.c +++ b/kernel/chips/bt869.c @@ -30,7 +30,8 @@ #include "version.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/ddcmon.c b/kernel/chips/ddcmon.c index 505f67d8..ad4bf32b 100644 --- a/kernel/chips/ddcmon.c +++ b/kernel/chips/ddcmon.c @@ -30,7 +30,8 @@ #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/eeprom.c b/kernel/chips/eeprom.c index c7b3951d..6ad7b2cf 100644 --- a/kernel/chips/eeprom.c +++ b/kernel/chips/eeprom.c @@ -29,7 +29,8 @@ #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/gl518sm.c b/kernel/chips/gl518sm.c index 1a1d6ccd..666d6e7d 100644 --- a/kernel/chips/gl518sm.c +++ b/kernel/chips/gl518sm.c @@ -34,7 +34,8 @@ #include #endif -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/gl520sm.c b/kernel/chips/gl520sm.c index 73814cc0..82ea9344 100644 --- a/kernel/chips/gl520sm.c +++ b/kernel/chips/gl520sm.c @@ -29,7 +29,8 @@ #include "version.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/icspll.c b/kernel/chips/icspll.c index cc2427a8..3c751c73 100644 --- a/kernel/chips/icspll.c +++ b/kernel/chips/icspll.c @@ -39,7 +39,8 @@ #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/lm75.c b/kernel/chips/lm75.c index 0d62fad7..c4dd9825 100644 --- a/kernel/chips/lm75.c +++ b/kernel/chips/lm75.c @@ -28,7 +28,8 @@ #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/lm78.c b/kernel/chips/lm78.c index 48afa3e9..6d3d87e4 100644 --- a/kernel/chips/lm78.c +++ b/kernel/chips/lm78.c @@ -33,7 +33,8 @@ #include "sensors.h" #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/lm80.c b/kernel/chips/lm80.c index 826eb3c7..a9778139 100644 --- a/kernel/chips/lm80.c +++ b/kernel/chips/lm80.c @@ -34,7 +34,8 @@ #include "sensors.h" #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/lm87.c b/kernel/chips/lm87.c index ab59229f..6c83133a 100644 --- a/kernel/chips/lm87.c +++ b/kernel/chips/lm87.c @@ -37,7 +37,8 @@ #include "sensors.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/ltc1710.c b/kernel/chips/ltc1710.c index fcee3c1a..9bece121 100644 --- a/kernel/chips/ltc1710.c +++ b/kernel/chips/ltc1710.c @@ -51,7 +51,8 @@ #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/matorb.c b/kernel/chips/matorb.c index e6f24a41..26544d32 100644 --- a/kernel/chips/matorb.c +++ b/kernel/chips/matorb.c @@ -31,7 +31,8 @@ #include "version.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/maxilife.c b/kernel/chips/maxilife.c index eba70a0c..93912241 100644 --- a/kernel/chips/maxilife.c +++ b/kernel/chips/maxilife.c @@ -67,7 +67,8 @@ static const char *version_str = "2.00 29/2/2000 Fons Rademakers"; #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/mtp008.c b/kernel/chips/mtp008.c index 3981f928..6dd55db1 100644 --- a/kernel/chips/mtp008.c +++ b/kernel/chips/mtp008.c @@ -33,7 +33,8 @@ #include "sensors.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/pcf8574.c b/kernel/chips/pcf8574.c index 7d3fa657..f1c04c52 100644 --- a/kernel/chips/pcf8574.c +++ b/kernel/chips/pcf8574.c @@ -48,7 +48,8 @@ #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/sis5595.c b/kernel/chips/sis5595.c index 2d123025..7dd62e1b 100644 --- a/kernel/chips/sis5595.c +++ b/kernel/chips/sis5595.c @@ -37,7 +37,8 @@ #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/thmc50.c b/kernel/chips/thmc50.c index 31838668..497e2056 100644 --- a/kernel/chips/thmc50.c +++ b/kernel/chips/thmc50.c @@ -30,7 +30,8 @@ #include "version.h" #include -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/via686a.c b/kernel/chips/via686a.c index dc4e26a0..9be4f8f9 100644 --- a/kernel/chips/via686a.c +++ b/kernel/chips/via686a.c @@ -44,7 +44,8 @@ #define PCI_DEVICE_ID_VIA_82C686_4 0x3057 #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif diff --git a/kernel/chips/w83781d.c b/kernel/chips/w83781d.c index 03e9f244..00444b1d 100644 --- a/kernel/chips/w83781d.c +++ b/kernel/chips/w83781d.c @@ -47,7 +47,8 @@ #include "sensors.h" #include -#ifndef init_MUTEX +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2,3,0)) #define init_MUTEX(s) do { *(s) = MUTEX; } while(0) #endif