mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-18 19:30:54 +00:00
Removal of kernel 2.1 and 2.2 compatibility: pass one
Removed many #if statements git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@704 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
7e0cd89eec
commit
9480bb5988
27 files changed
+4
-381
No files matched your search
@@ -28,12 +28,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -62,12 +62,7 @@
|
||||
#include "i2c-isa.h"
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
|
||||
@@ -29,12 +29,7 @@
|
||||
#include "i2c-isa.h"
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
|
||||
@@ -28,13 +28,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -29,12 +29,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
#ifdef __SMP__
|
||||
#include <linux/smp_lock.h>
|
||||
@@ -156,10 +151,8 @@ struct gl518_data {
|
||||
struct semaphore update_lock;
|
||||
|
||||
int iterate_lock;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
int quit_thread;
|
||||
struct task_struct *thread;
|
||||
#endif
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)
|
||||
wait_queue_head_t wq;
|
||||
#else
|
||||
@@ -406,10 +399,8 @@ static int gl518_detect(struct i2c_adapter *adapter, int address,
|
||||
/* Initialize the GL518SM chip */
|
||||
data->iterate = 0;
|
||||
data->iterate_lock = 0;
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
data->quit_thread = 0;
|
||||
data->thread = NULL;
|
||||
#endif
|
||||
data->alarm_mask = 0xff;
|
||||
gl518_init_client((struct i2c_client *) new_client);
|
||||
return 0;
|
||||
@@ -492,12 +483,10 @@ int gl518_detach_client(struct i2c_client *client)
|
||||
}
|
||||
gl518_list[i] = NULL;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
if (data->thread) {
|
||||
data->quit_thread = 1;
|
||||
wake_up_interruptible(&data->wq);
|
||||
}
|
||||
#endif
|
||||
|
||||
kfree(client);
|
||||
|
||||
@@ -651,7 +640,6 @@ void gl518_update_client_rev00(struct i2c_client *client)
|
||||
}
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
int gl518_update_thread(void *c)
|
||||
{
|
||||
struct i2c_client *client = c;
|
||||
@@ -694,7 +682,6 @@ int gl518_update_thread(void *c)
|
||||
data->quit_thread = 0;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This updates vdd, vin1, vin2 values by doing slow and multiple
|
||||
comparisons for the GL518SM rev 00 that lacks support for direct
|
||||
@@ -734,11 +721,9 @@ void gl518_update_iterate(struct i2c_client *client)
|
||||
for (i=0; i<3; i++)
|
||||
gl518_write_value(client, VIN_REG(i), max[i] << 8 | min[i]);
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
if ((data->thread) &&
|
||||
((data->quit_thread) || signal_pending(current)))
|
||||
goto finish;
|
||||
#endif
|
||||
|
||||
/* we wait now 1.5 seconds before comparing */
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
@@ -1007,7 +992,6 @@ void gl518_iterate(struct i2c_client *client, int operation, int ctl_name,
|
||||
}
|
||||
data->valid=0;
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68)
|
||||
if ((data->iterate != 2) && (data->thread)) {
|
||||
data->quit_thread = 1;
|
||||
wake_up_interruptible(&data->wq);
|
||||
@@ -1019,7 +1003,6 @@ void gl518_iterate(struct i2c_client *client, int operation, int ctl_name,
|
||||
#endif
|
||||
kernel_thread(gl518_update_thread, (void*) client, 0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,13 +29,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {0x2c,0x2d,SENSORS_I2C_END};
|
||||
|
||||
@@ -35,12 +35,7 @@
|
||||
#include "sensors.h"
|
||||
#include "i2c-isa.h"
|
||||
#include "version.h"
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Many constants specified below */
|
||||
|
||||
@@ -27,13 +27,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -33,13 +33,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -34,13 +34,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -50,13 +50,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -31,13 +31,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {0x2E,SENSORS_I2C_END};
|
||||
|
||||
@@ -53,13 +53,7 @@ static const char *version_str = "1.00 25/2/99 Fons Rademakers";
|
||||
#include "i2c-isa.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#undef AUTODETECT /* try to autodetect MaxiLife version */
|
||||
|
||||
@@ -27,9 +27,6 @@
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/pci.h>
|
||||
#if LINUX_VERSION_CODE < 0x020136 /* 2.1.54 */
|
||||
#include <linux/bios32.h>
|
||||
#endif
|
||||
#include <asm/errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <linux/types.h>
|
||||
@@ -39,13 +36,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan.
|
||||
Note that we can't determine the ISA address until we have initialized
|
||||
@@ -274,25 +265,15 @@ int sis5595_attach_adapter(struct i2c_adapter *adapter)
|
||||
/* Locate SiS bridge and correct base address for SIS5595 */
|
||||
int sis5595_find_sis(int *address)
|
||||
{
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
struct pci_dev *s_bridge;
|
||||
#else
|
||||
unsigned char SIS_bus, SIS_devfn;
|
||||
#endif
|
||||
u16 val;
|
||||
|
||||
if (! pci_present())
|
||||
return -ENODEV;
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
|
||||
if (! (s_bridge = pci_find_device(
|
||||
PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, NULL)))
|
||||
|
||||
#else
|
||||
if(pcibios_find_device(
|
||||
PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, 0,
|
||||
&SIS_bus, &SIS_devfn))
|
||||
#endif
|
||||
return -ENODEV;
|
||||
|
||||
|
||||
|
||||
@@ -30,13 +30,7 @@
|
||||
#include "version.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
|
||||
/* Addresses to scan */
|
||||
static unsigned short normal_i2c[] = {SENSORS_I2C_END};
|
||||
|
||||
@@ -47,12 +47,7 @@
|
||||
#include "sensors.h"
|
||||
#include "compat.h"
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
|
||||
#include <linux/init.h>
|
||||
#else
|
||||
#define __init
|
||||
#define __initdata
|
||||
#endif
|
||||
|
||||
/* RT Table support #defined so we can take it out if it gets bothersome */
|
||||
#define W83781D_RT 1
|
||||
|
||||
Reference in new issue
Block a user