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:
Frodo Looijaard committed 2000-01-24 19:30:08 +00:00
1 parent 7e0cd89eec
commit 9480bb5988
27 files changed
+4 -381

No files matched your search

-22
View File
@@ -72,16 +72,7 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
#undef FORCE_ALI15X3_ENABLE
@@ -194,12 +185,7 @@ int ali15x3_setup(void)
int error_return=0;
unsigned char temp;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *ALI15X3_dev;
#else
unsigned char ALI15X3_bus, ALI15X3_devfn = 0;
int res;
#endif
/* First check whether we can access PCI at all */
if (pci_present() == 0) {
@@ -209,18 +195,10 @@ int ali15x3_setup(void)
}
/* Look for the ALI15X3, M7101 device */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
ALI15X3_dev = NULL;
ALI15X3_dev = pci_find_device(PCI_VENDOR_ID_AL,
PCI_DEVICE_ID_AL_M7101, ALI15X3_dev);
if(ALI15X3_dev == NULL) {
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
res = pcibios_find_device(PCI_VENDOR_ID_AL,
PCI_DEVICE_ID_AL_M7101,
0,&ALI15X3_bus, &ALI15X3_devfn);
if (res) {
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
printk("i2c-ali15x3.o: Error: Can't detect ali15x3!\n");
error_return=-ENODEV;
goto END;
-25
View File
@@ -38,16 +38,7 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* AMD756 SMBus address offsets */
#define SMB_GLOBAL_STATUS (0xE0 + amd756_smba)
@@ -144,12 +135,7 @@ int amd756_setup(void)
int error_return=0;
unsigned char temp;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *AMD756_dev;
#else
unsigned char AMD756_bus, AMD756_devfn;
int i,res;
#endif
/* First check whether we can access PCI at all */
if (pci_present() == 0) {
@@ -159,7 +145,6 @@ int amd756_setup(void)
}
/* Look for the AMD756, function 3 */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
/* Note: we keep on searching until we have found 'function 3' */
AMD756_dev = NULL;
do
@@ -167,16 +152,6 @@ int amd756_setup(void)
PCI_DEVICE_ID_AMD_756, AMD756_dev);
while (AMD756_dev && (PCI_FUNC(AMD756_dev->devfn) != 3));
if(AMD756_dev == NULL) {
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
for (i = 0;
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3,
i,&AMD756_bus, &AMD756_devfn)) &&
PCI_FUNC(AMD756_devfn) != 3;
i++);
if (res) {
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
printk("i2c-amd756.o: Error: Can't detect AMD756, function 3!\n");
error_return=-ENODEV;
goto END;
+1 -22
View File
@@ -36,16 +36,7 @@
#include <linux/i2c-algo-bit.h>
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* PCI device */
#define VENDOR PCI_VENDOR_ID_APPLE
@@ -145,24 +136,14 @@ struct i2c_adapter bit_hydra_ops = {
static int find_hydra(void)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *dev;
#else
unsigned char bus, devfn;
int res;
#endif
unsigned int base_addr;
if (!pci_present())
return -ENODEV;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)
dev = pci_find_device(VENDOR, DEVICE, NULL);
if (!dev) {
#else
res = pcibios_find_device(VENDOR,DEVICE,0,&bus, &devfn);
if (res) {
#endif
printk("Hydra not found\n");
return -ENODEV;
}
@@ -170,10 +151,8 @@ static int find_hydra(void)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13)
base_addr = dev->resource[0].start;
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
base_addr = dev->base_address[0];
#else
pcibios_read_config_dword(bus, devfn,PCI_BASE_ADDRESS_0,&base_addr);
base_addr = dev->base_address[0];
#endif
hydra_base = (unsigned long)ioremap(base_addr, 0x100);
-27
View File
@@ -39,10 +39,6 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
/* I801 SMBus address offsets */
#define SMBHSTSTS (0 + i801_smba)
#define SMBHSTCNT (2 + i801_smba)
@@ -138,12 +134,7 @@ int i801_setup(void)
int error_return=0;
unsigned char temp;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *I801_dev;
#else
unsigned char I801_bus, I801_devfn;
int i,res;
#endif
/* First check whether we can access PCI at all */
if (pci_present() == 0) {
@@ -154,7 +145,6 @@ int i801_setup(void)
/* Look for the I801, function 3 */
/* Have to check for both the 82801AA and 82801AB */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
/* Note: we keep on searching until we have found 'function 3' */
I801_dev = NULL;
do
@@ -168,23 +158,6 @@ int i801_setup(void)
while(I801_dev && (PCI_FUNC(I801_dev->devfn) != 3));
}
if(I801_dev == NULL) {
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
for (i = 0;
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82801AA_3,
i,&I801_bus, &I801_devfn)) &&
PCI_FUNC(I801_devfn) != 3;
i++);
if (res) {
for (i = 0;
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82801AB_3,
i,&I801_bus, &I801_devfn)) &&
PCI_FUNC(I801_devfn) != 3;
i++);
}
if (res) {
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
printk("i2c-i801.o: Error: Can't detect I801, function 3!\n");
error_return=-ENODEV;
goto END;
-5
View File
@@ -32,12 +32,7 @@
#include "compat.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
#include "version.h"
#include "i2c-isa.h"
-25
View File
@@ -33,16 +33,7 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* PIIX4 SMBus address offsets */
#define SMBHSTSTS (0 + piix4_smba)
@@ -149,12 +140,7 @@ int piix4_setup(void)
int error_return=0;
unsigned char temp;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *PIIX4_dev;
#else
unsigned char PIIX4_bus, PIIX4_devfn;
int i,res;
#endif
/* First check whether we can access PCI at all */
if (pci_present() == 0) {
@@ -164,7 +150,6 @@ int piix4_setup(void)
}
/* Look for the PIIX4, function 3 */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
/* Note: we keep on searching until we have found 'function 3' */
PIIX4_dev = NULL;
do
@@ -172,16 +157,6 @@ int piix4_setup(void)
PCI_DEVICE_ID_INTEL_82371AB_3, PIIX4_dev);
while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3));
if(PIIX4_dev == NULL) {
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
for (i = 0;
! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3,
i,&PIIX4_bus, &PIIX4_devfn)) &&
PCI_FUNC(PIIX4_devfn) != 3;
i++);
if (res) {
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
printk("i2c-piix4.o: Error: Can't detect PIIX4, function 3!\n");
error_return=-ENODEV;
goto END;
-20
View File
@@ -38,16 +38,7 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* SIS5595 SMBus registers */
#define SMB_STS_LO 0x00
@@ -150,12 +141,7 @@ int sis5595_setup(void)
{
int error_return=0;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *SIS5595_dev;
#else
unsigned char SIS5595_bus, SIS5595_devfn;
int i,res;
#endif
/* First check whether we can access PCI at all */
if (pci_present() == 0) {
@@ -165,15 +151,9 @@ int sis5595_setup(void)
}
/* Look for the SIS5595, function 3 */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
SIS5595_dev = NULL;
if (!(SIS5595_dev = pci_find_device(PCI_VENDOR_ID_SI,
PCI_DEVICE_ID_SI_503, SIS5595_dev))) {
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
if ((res = pcibios_find_device(PCI_VENDOR_ID_SI,
PCI_DEVICE_ID_SI_503,
i,&SIS5595_bus, &SIS5595_devfn))) {
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
printk("i2c-sis5595.o: Error: Can't detect SIS5595!\n");
error_return=-ENODEV;
goto END;
-53
View File
@@ -29,20 +29,11 @@
#include <asm/io.h>
#include <linux/types.h>
#if LINUX_VERSION_CODE < 0x020136 /* 2.1.54 */
#include <linux/bios32.h>
#endif
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include "compat.h"
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* PCI device */
#define VENDOR PCI_VENDOR_ID_VIA
@@ -127,7 +118,6 @@ static struct i2c_adapter bit_via_ops = {
/* When exactly was the new pci interface introduced? */
#if LINUX_VERSION_CODE >= 0x020136 /* 2.1.54 */
static int find_via(void)
{
struct pci_dev *s_bridge;
@@ -168,49 +158,6 @@ static int find_via(void)
return 0;
}
#else
static int find_via(void)
{
unsigned char VIA_bus, VIA_devfn;
u16 base;
u8 rev;
if (! pcibios_present())
return -ENODEV;
if(pcibios_find_device(VENDOR, DEVICE, 0, &VIA_bus, &VIA_devfn))
{
printk("vt82c586b not found\n");
return -ENODEV;
}
if ( PCIBIOS_SUCCESSFUL !=
pcibios_read_config_byte(VIA_bus, VIA_devfn,
PM_CFG_REVID, &rev))
return -ENODEV;
switch(rev)
{
case 0x00: base = PM_CFG_IOBASE0;
break;
case 0x01:
case 0x10: base = PM_CFG_IOBASE1;
break;
default : base = PM_CFG_IOBASE1;
/* later revision */
}
if ( PCIBIOS_SUCCESSFUL !=
pcibios_read_config_word(VIA_bus, VIA_devfn, base, &pm_io_base))
return -ENODEV;
pm_io_base &= (0xff<<8);
return 0;
}
#endif
#ifdef MODULE
static
#else
-34
View File
@@ -33,17 +33,7 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
#ifndef PCI_DEVICE_ID_VIA_82C596_3
#define PCI_DEVICE_ID_VIA_82C596_3 0x3050
@@ -166,12 +156,7 @@ int vt596_setup(void)
int error_return=0;
unsigned char temp;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
struct pci_dev *VT596_dev;
#else
unsigned char VT596_bus, VT596_devfn;
int i,res;
#endif
/* First check whether we can access PCI at all */
if (pci_present() == 0) {
@@ -181,7 +166,6 @@ int vt596_setup(void)
}
/* Look for the VT596 function 3 _or_ VT686 function 4 */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54))
VT596_dev = NULL;
VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_82C596_3, VT596_dev);
@@ -190,24 +174,6 @@ int vt596_setup(void)
PCI_DEVICE_ID_VIA_82C686_4, VT596_dev);
if (VT596_dev == NULL) {
#else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */
for (i = 0;
! (res = pcibios_find_device(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_82C596_3,
i,&VT596_bus, &VT596_devfn)) &&
PCI_FUNC(VT596_devfn) != 3;
i++);
if (res)
for (i = 0;
! (res = pcibios_find_device(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_82C686_4,
i,&VT596_bus, &VT596_devfn)) &&
PCI_FUNC(VT596_devfn) != 4;
i++);
if (res) {
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */
printk("i2c-viapro.o: Error: Can't detect vt82c596 or vt82c686");
error_return=-ENODEV;
goto END;
+1 -19
View File
@@ -42,27 +42,12 @@
#include "version.h"
#include "compat.h"
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54))
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* 3DFX defines */
#ifndef PCI_VENDOR_ID_3DFX
#define PCI_VENDOR_ID_3DFX 0x121a
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO3
#define PCI_DEVICE_ID_3DFX_VOODOO3 0x05
#endif
#ifndef PCI_DEVICE_ID_3DFX_BANSHEE
#define PCI_DEVICE_ID_3DFX_BANSHEE 0x03
#endif
#ifdef MODULE
static
@@ -680,11 +665,8 @@ void config_v3(struct pci_dev *dev)
/* map Voodoo3 memory */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13)
cadr = dev->resource[0].start;
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)
cadr = dev->base_address[0];
#else
pcibios_read_config_dword(dev->bus->number, dev->devfn,
PCI_BASE_ADDRESS_0,&cadr);
cadr = dev->base_address[0];
#endif
cadr&=PCI_BASE_ADDRESS_MEM_MASK;
mem=ioremap(cadr, 0x1000);