Changeset 704

Show
Ignore:
Timestamp:
01/24/00 20:30:08 (13 years ago)
Author:
frodo
Message:

Removal of kernel 2.1 and 2.2 compatibility: pass one

Removed many #if statements

Location:
lm-sensors/trunk/kernel
Files:
27 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/kernel/busses/i2c-ali15x3.c

    r689 r704  
    7373#include "compat.h" 
    7474 
    75 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    76 #include <linux/bios32.h> 
    77 #endif 
    78  
    79 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    8075#include <linux/init.h> 
    81 #else 
    82 #define __init  
    83 #define __initdata  
    84 #endif 
    8576 
    8677#undef FORCE_ALI15X3_ENABLE 
     
    195186  unsigned char temp; 
    196187 
    197 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    198188  struct pci_dev *ALI15X3_dev; 
    199 #else 
    200   unsigned char ALI15X3_bus, ALI15X3_devfn = 0; 
    201   int res; 
    202 #endif 
    203189 
    204190  /* First check whether we can access PCI at all */ 
     
    210196 
    211197  /* Look for the ALI15X3, M7101 device */ 
    212 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    213198  ALI15X3_dev = NULL; 
    214199  ALI15X3_dev = pci_find_device(PCI_VENDOR_ID_AL,  
    215200                                PCI_DEVICE_ID_AL_M7101, ALI15X3_dev); 
    216201  if(ALI15X3_dev == NULL) { 
    217 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ 
    218     res = pcibios_find_device(PCI_VENDOR_ID_AL, 
    219                                     PCI_DEVICE_ID_AL_M7101, 
    220                                     0,&ALI15X3_bus, &ALI15X3_devfn); 
    221       
    222   if (res) { 
    223 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ 
    224202    printk("i2c-ali15x3.o: Error: Can't detect ali15x3!\n"); 
    225203    error_return=-ENODEV; 
  • lm-sensors/trunk/kernel/busses/i2c-amd756.c

    r658 r704  
    3939#include "compat.h" 
    4040 
    41 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    42 #include <linux/bios32.h> 
    43 #endif 
    44  
    45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4641#include <linux/init.h> 
    47 #else 
    48 #define __init 
    49 #define __initdata 
    50 #endif 
    5142 
    5243/* AMD756 SMBus address offsets */ 
     
    145136  unsigned char temp; 
    146137 
    147 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    148138  struct pci_dev *AMD756_dev; 
    149 #else 
    150   unsigned char AMD756_bus, AMD756_devfn; 
    151   int i,res; 
    152 #endif 
    153139 
    154140  /* First check whether we can access PCI at all */ 
     
    160146 
    161147  /* Look for the AMD756, function 3 */ 
    162 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    163148  /* Note: we keep on searching until we have found 'function 3' */ 
    164149  AMD756_dev = NULL; 
     
    168153  while (AMD756_dev && (PCI_FUNC(AMD756_dev->devfn) != 3)); 
    169154  if(AMD756_dev == NULL) { 
    170 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ 
    171   for (i = 0;  
    172        ! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL, 
    173                                     PCI_DEVICE_ID_INTEL_82371AB_3, 
    174                                     i,&AMD756_bus, &AMD756_devfn)) &&  
    175          PCI_FUNC(AMD756_devfn) != 3;  
    176        i++); 
    177       
    178   if (res) { 
    179 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ 
    180155    printk("i2c-amd756.o: Error: Can't detect AMD756, function 3!\n"); 
    181156    error_return=-ENODEV; 
  • lm-sensors/trunk/kernel/busses/i2c-hydra.c

    r647 r704  
    3737#include "compat.h" 
    3838 
    39 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    40 #include <linux/bios32.h> 
    41 #endif 
    42  
    43 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4439#include <linux/init.h> 
    45 #else 
    46 #define __init 
    47 #define __initdata 
    48 #endif 
    4940 
    5041/* PCI device */ 
     
    146137static int find_hydra(void) 
    147138{ 
    148 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    149139        struct pci_dev *dev; 
    150 #else 
    151         unsigned char bus, devfn; 
    152         int res; 
    153 #endif 
    154140        unsigned int base_addr; 
    155141 
     
    157143                return -ENODEV; 
    158144                 
    159 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) 
    160145        dev = pci_find_device(VENDOR, DEVICE, NULL); 
    161146        if (!dev) { 
    162 #else 
    163         res = pcibios_find_device(VENDOR,DEVICE,0,&bus, &devfn); 
    164         if (res) { 
    165 #endif 
    166147                printk("Hydra not found\n"); 
    167148                return -ENODEV; 
     
    171152#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) 
    172153        base_addr = dev->resource[0].start; 
    173 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
     154#else 
    174155        base_addr = dev->base_address[0]; 
    175 #else 
    176         pcibios_read_config_dword(bus, devfn,PCI_BASE_ADDRESS_0,&base_addr); 
    177156#endif 
    178157        hydra_base = (unsigned long)ioremap(base_addr, 0x100); 
  • lm-sensors/trunk/kernel/busses/i2c-i801.c

    r689 r704  
    4040#include "compat.h" 
    4141 
    42 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    43 #include <linux/bios32.h> 
    44 #endif 
    45  
    4642/* I801 SMBus address offsets */ 
    4743#define SMBHSTSTS (0 + i801_smba) 
     
    139135  unsigned char temp; 
    140136 
    141 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    142137  struct pci_dev *I801_dev; 
    143 #else 
    144   unsigned char I801_bus, I801_devfn; 
    145   int i,res; 
    146 #endif 
    147138 
    148139  /* First check whether we can access PCI at all */ 
     
    155146  /* Look for the I801, function 3 */ 
    156147  /* Have to check for both the 82801AA and 82801AB */ 
    157 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    158148  /* Note: we keep on searching until we have found 'function 3' */ 
    159149  I801_dev = NULL; 
     
    169159  } 
    170160  if(I801_dev == NULL) { 
    171 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ 
    172   for (i = 0;  
    173        ! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL, 
    174                                     PCI_DEVICE_ID_INTEL_82801AA_3, 
    175                                     i,&I801_bus, &I801_devfn)) &&  
    176          PCI_FUNC(I801_devfn) != 3;  
    177        i++); 
    178   if (res) { 
    179     for (i = 0;  
    180          ! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL, 
    181                                       PCI_DEVICE_ID_INTEL_82801AB_3, 
    182                                       i,&I801_bus, &I801_devfn)) &&  
    183            PCI_FUNC(I801_devfn) != 3;  
    184          i++); 
    185   } 
    186   if (res) { 
    187 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ 
    188161    printk("i2c-i801.o: Error: Can't detect I801, function 3!\n"); 
    189162    error_return=-ENODEV; 
  • lm-sensors/trunk/kernel/busses/i2c-isa.c

    r645 r704  
    3333#include "compat.h" 
    3434 
    35 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3635#include <linux/init.h> 
    37 #else 
    38 #define __init 
    39 #define __initdata 
    40 #endif 
    4136 
    4237#include "version.h" 
  • lm-sensors/trunk/kernel/busses/i2c-piix4.c

    r653 r704  
    3434#include "compat.h" 
    3535 
    36 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    37 #include <linux/bios32.h> 
    38 #endif 
    39  
    40 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4136#include <linux/init.h> 
    42 #else 
    43 #define __init 
    44 #define __initdata 
    45 #endif 
    4637 
    4738/* PIIX4 SMBus address offsets */ 
     
    150141  unsigned char temp; 
    151142 
    152 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    153143  struct pci_dev *PIIX4_dev; 
    154 #else 
    155   unsigned char PIIX4_bus, PIIX4_devfn; 
    156   int i,res; 
    157 #endif 
    158144 
    159145  /* First check whether we can access PCI at all */ 
     
    165151 
    166152  /* Look for the PIIX4, function 3 */ 
    167 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    168153  /* Note: we keep on searching until we have found 'function 3' */ 
    169154  PIIX4_dev = NULL; 
     
    173158  while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3)); 
    174159  if(PIIX4_dev == NULL) { 
    175 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ 
    176   for (i = 0;  
    177        ! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL, 
    178                                     PCI_DEVICE_ID_INTEL_82371AB_3, 
    179                                     i,&PIIX4_bus, &PIIX4_devfn)) &&  
    180          PCI_FUNC(PIIX4_devfn) != 3;  
    181        i++); 
    182       
    183   if (res) { 
    184 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ 
    185160    printk("i2c-piix4.o: Error: Can't detect PIIX4, function 3!\n"); 
    186161    error_return=-ENODEV; 
  • lm-sensors/trunk/kernel/busses/i2c-sis5595.c

    r674 r704  
    3939#include "compat.h" 
    4040 
    41 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    42 #include <linux/bios32.h> 
    43 #endif 
    44  
    45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4641#include <linux/init.h> 
    47 #else 
    48 #define __init 
    49 #define __initdata 
    50 #endif 
    5142 
    5243/* SIS5595 SMBus registers */ 
     
    151142  int error_return=0; 
    152143 
    153 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    154144  struct pci_dev *SIS5595_dev; 
    155 #else 
    156   unsigned char SIS5595_bus, SIS5595_devfn; 
    157   int i,res; 
    158 #endif 
    159145 
    160146  /* First check whether we can access PCI at all */ 
     
    166152 
    167153  /* Look for the SIS5595, function 3 */ 
    168 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    169154  SIS5595_dev = NULL; 
    170155  if (!(SIS5595_dev = pci_find_device(PCI_VENDOR_ID_SI,  
    171156                              PCI_DEVICE_ID_SI_503, SIS5595_dev))) { 
    172 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ 
    173   if ((res =  pcibios_find_device(PCI_VENDOR_ID_SI, 
    174                                     PCI_DEVICE_ID_SI_503, 
    175                                     i,&SIS5595_bus, &SIS5595_devfn))) { 
    176 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ 
    177157    printk("i2c-sis5595.o: Error: Can't detect SIS5595!\n"); 
    178158    error_return=-ENODEV; 
  • lm-sensors/trunk/kernel/busses/i2c-via.c

    r647 r704  
    3030#include <linux/types.h> 
    3131 
    32 #if LINUX_VERSION_CODE < 0x020136 /* 2.1.54 */ 
    33 #include <linux/bios32.h> 
    34 #endif 
    35  
    3632#include <linux/i2c.h> 
    3733#include <linux/i2c-algo-bit.h> 
    3834#include "compat.h" 
    3935 
    40 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4136#include <linux/init.h> 
    42 #else 
    43 #define __init 
    44 #define __initdata 
    45 #endif 
    4637 
    4738/* PCI device */ 
     
    128119 
    129120/* When exactly was the new pci interface introduced? */ 
    130 #if LINUX_VERSION_CODE >= 0x020136 /* 2.1.54 */ 
    131121static int find_via(void) 
    132122{ 
     
    169159} 
    170160 
    171 #else 
    172  
    173 static int find_via(void) 
    174 { 
    175         unsigned char VIA_bus, VIA_devfn; 
    176         u16 base; 
    177         u8 rev; 
    178          
    179         if (! pcibios_present()) 
    180                 return -ENODEV; 
    181                  
    182         if(pcibios_find_device(VENDOR, DEVICE, 0, &VIA_bus, &VIA_devfn)) 
    183         { 
    184                 printk("vt82c586b not found\n"); 
    185                 return -ENODEV; 
    186         } 
    187          
    188         if ( PCIBIOS_SUCCESSFUL !=  
    189                 pcibios_read_config_byte(VIA_bus, VIA_devfn, 
    190                                         PM_CFG_REVID, &rev)) 
    191                 return -ENODEV; 
    192  
    193         switch(rev) 
    194         { 
    195                 case 0x00:      base = PM_CFG_IOBASE0; 
    196                                 break; 
    197                 case 0x01: 
    198                 case 0x10:      base = PM_CFG_IOBASE1; 
    199                                 break; 
    200                                  
    201                 default :       base = PM_CFG_IOBASE1; 
    202                                 /* later revision */     
    203         }        
    204  
    205         if ( PCIBIOS_SUCCESSFUL != 
    206                 pcibios_read_config_word(VIA_bus, VIA_devfn, base, &pm_io_base)) 
    207                 return -ENODEV; 
    208  
    209         pm_io_base &= (0xff<<8); 
    210         return 0; 
    211 } 
    212 #endif 
    213  
    214161#ifdef MODULE 
    215162static 
  • lm-sensors/trunk/kernel/busses/i2c-viapro.c

    r645 r704  
    3434#include "compat.h" 
    3535 
    36 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    37 #include <linux/bios32.h> 
    38 #endif 
    39  
    40 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4136#include <linux/init.h> 
    42 #else 
    43 #define __init 
    44 #define __initdata 
    45 #endif 
    46  
    4737 
    4838#ifndef PCI_DEVICE_ID_VIA_82C596_3 
     
    167157  unsigned char temp; 
    168158 
    169 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    170159  struct pci_dev *VT596_dev; 
    171 #else 
    172   unsigned char VT596_bus, VT596_devfn; 
    173   int i,res; 
    174 #endif 
    175160 
    176161  /* First check whether we can access PCI at all */ 
     
    182167 
    183168  /* Look for the VT596 function 3   _or_  VT686 function 4 */ 
    184 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    185169  VT596_dev = NULL; 
    186170  VT596_dev = pci_find_device(PCI_VENDOR_ID_VIA,  
     
    191175 
    192176  if (VT596_dev == NULL) { 
    193 #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ 
    194   for (i = 0;  
    195        ! (res = pcibios_find_device(PCI_VENDOR_ID_VIA, 
    196                                     PCI_DEVICE_ID_VIA_82C596_3, 
    197                                     i,&VT596_bus, &VT596_devfn)) &&  
    198          PCI_FUNC(VT596_devfn) != 3;  
    199        i++); 
    200    
    201   if (res) 
    202     for (i = 0;  
    203        ! (res = pcibios_find_device(PCI_VENDOR_ID_VIA, 
    204                                     PCI_DEVICE_ID_VIA_82C686_4, 
    205                                     i,&VT596_bus, &VT596_devfn)) &&  
    206          PCI_FUNC(VT596_devfn) != 4;  
    207        i++); 
    208  
    209   if (res) { 
    210 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ 
    211177    printk("i2c-viapro.o: Error: Can't detect vt82c596 or vt82c686"); 
    212178    error_return=-ENODEV; 
  • lm-sensors/trunk/kernel/busses/i2c-voodoo3.c

    r698 r704  
    4343#include "compat.h" 
    4444 
    45 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    46 #include <linux/bios32.h> 
    47 #endif 
    48  
    49 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    5045#include <linux/init.h> 
    51 #else 
    52 #define __init 
    53 #define __initdata 
    54 #endif 
    5546 
    5647/* 3DFX defines */ 
    57 #ifndef PCI_VENDOR_ID_3DFX 
    58 #define PCI_VENDOR_ID_3DFX 0x121a 
    59 #endif 
    6048#ifndef PCI_DEVICE_ID_3DFX_VOODOO3 
    6149#define PCI_DEVICE_ID_3DFX_VOODOO3 0x05 
    62 #endif 
    63 #ifndef PCI_DEVICE_ID_3DFX_BANSHEE 
    64 #define PCI_DEVICE_ID_3DFX_BANSHEE 0x03 
    6550#endif 
    6651 
     
    681666#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13) 
    682667        cadr = dev->resource[0].start; 
    683 #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) 
     668#else 
    684669        cadr = dev->base_address[0]; 
    685 #else 
    686         pcibios_read_config_dword(dev->bus->number, dev->devfn, 
    687                                   PCI_BASE_ADDRESS_0,&cadr); 
    688670#endif 
    689671        cadr&=PCI_BASE_ADDRESS_MEM_MASK; 
  • lm-sensors/trunk/kernel/chips/adm1021.c

    r667 r704  
    2929#include "compat.h" 
    3030 
    31 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3231#include <linux/init.h> 
    33 #else 
    34 #define __init 
    35 #define __initdata 
    36 #endif 
    3732 
    3833/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/adm9240.c

    r667 r704  
    6363#include "sensors.h" 
    6464#include "compat.h" 
    65 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    6665#include <linux/init.h> 
    67 #else 
    68 #define __init 
    69 #define __initdata 
    70 #endif 
    7166 
    7267 
  • lm-sensors/trunk/kernel/chips/bt869.c

    r667 r704  
    3030#include "version.h" 
    3131#include "compat.h" 
    32 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3332#include <linux/init.h> 
    34 #else 
    35 #define __init 
    36 #define __initdata 
    37 #endif 
    3833 
    3934 
  • lm-sensors/trunk/kernel/chips/eeprom.c

    r667 r704  
    2929#include "compat.h" 
    3030 
    31 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3231#include <linux/init.h> 
    33 #else 
    34 #define __init 
    35 #define __initdata 
    36 #endif 
    37  
    3832 
    3933/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/gl518sm.c

    r667 r704  
    3030#include "compat.h" 
    3131 
    32 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3332#include <linux/init.h> 
    34 #else 
    35 #define __init 
    36 #define __initdata 
    37 #endif 
    3833 
    3934#ifdef __SMP__ 
     
    157152 
    158153         int iterate_lock; 
    159 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    160154         int quit_thread; 
    161155         struct task_struct *thread; 
    162 #endif 
    163156#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1) 
    164157         wait_queue_head_t wq; 
     
    407400  data->iterate = 0; 
    408401  data->iterate_lock = 0; 
    409 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    410402  data->quit_thread = 0; 
    411403  data->thread = NULL; 
    412 #endif 
    413404  data->alarm_mask = 0xff; 
    414405  gl518_init_client((struct i2c_client *) new_client); 
     
    493484  gl518_list[i] = NULL; 
    494485   
    495 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    496486  if (data->thread) { 
    497487    data->quit_thread = 1; 
    498488    wake_up_interruptible(&data->wq); 
    499489  } 
    500 #endif 
    501490 
    502491  kfree(client); 
     
    652641} 
    653642 
    654 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    655643int gl518_update_thread(void *c) 
    656644{ 
     
    695683  return 0; 
    696684} 
    697 #endif 
    698685 
    699686/* This updates vdd, vin1, vin2 values by doing slow and multiple 
     
    735722      gl518_write_value(client, VIN_REG(i), max[i] << 8 | min[i]); 
    736723 
    737 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    738724    if ((data->thread) &&  
    739725       ((data->quit_thread) || signal_pending(current)))  
    740726      goto finish; 
    741 #endif 
    742727 
    743728    /* we wait now 1.5 seconds before comparing */ 
     
    1008993      data->valid=0; 
    1009994       
    1010 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    1011995      if ((data->iterate != 2) && (data->thread)) { 
    1012996         data->quit_thread = 1; 
     
    10201004         kernel_thread(gl518_update_thread, (void*) client, 0); 
    10211005      } 
    1022 #endif 
    10231006    } 
    10241007  } 
  • lm-sensors/trunk/kernel/chips/gl520sm.c

    r667 r704  
    3030#include "compat.h" 
    3131 
    32 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3332#include <linux/init.h> 
    34 #else 
    35 #define __init 
    36 #define __initdata 
    37 #endif 
    38  
    3933 
    4034/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/icspll.c

    r688 r704  
    3636#include "i2c-isa.h" 
    3737#include "version.h" 
    38 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3938#include <linux/init.h> 
    40 #else 
    41 #define __init 
    42 #define __initdata 
    43 #endif 
    4439 
    4540 
  • lm-sensors/trunk/kernel/chips/lm75.c

    r670 r704  
    2828#include "compat.h" 
    2929 
    30 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3130#include <linux/init.h> 
    32 #else 
    33 #define __init 
    34 #define __initdata 
    35 #endif 
    36  
    3731 
    3832/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/lm78.c

    r667 r704  
    3434#include "compat.h" 
    3535 
    36 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3736#include <linux/init.h> 
    38 #else 
    39 #define __init 
    40 #define __initdata 
    41 #endif 
    42  
    4337 
    4438/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/lm80.c

    r691 r704  
    3535#include "compat.h" 
    3636 
    37 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3837#include <linux/init.h> 
    39 #else 
    40 #define __init 
    41 #define __initdata 
    42 #endif 
    43  
    4438 
    4539/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/ltc1710.c

    r667 r704  
    5151#include "compat.h" 
    5252 
    53 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    5453#include <linux/init.h> 
    55 #else 
    56 #define __init 
    57 #define __initdata 
    58 #endif 
    59  
    6054 
    6155/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/matorb.c

    r667 r704  
    3232#include "compat.h" 
    3333 
    34 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3534#include <linux/init.h> 
    36 #else 
    37 #define __init 
    38 #define __initdata 
    39 #endif 
    40  
    4135 
    4236/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/maxilife.c

    r645 r704  
    5454#include "compat.h" 
    5555 
    56 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    5756#include <linux/init.h> 
    58 #else 
    59 #define __init 
    60 #define __initdata 
    61 #endif 
    62  
    6357 
    6458 
  • lm-sensors/trunk/kernel/chips/sis5595.c

    r645 r704  
    2828#include <linux/sysctl.h> 
    2929#include <linux/pci.h> 
    30 #if LINUX_VERSION_CODE < 0x020136 /* 2.1.54 */ 
    31 #include <linux/bios32.h> 
    32 #endif 
    3330#include <asm/errno.h> 
    3431#include <asm/io.h> 
     
    4037#include "compat.h" 
    4138 
    42 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    4339#include <linux/init.h> 
    44 #else 
    45 #define __init 
    46 #define __initdata 
    47 #endif 
    48  
    4940 
    5041/* Addresses to scan. 
     
    275266int sis5595_find_sis(int *address) 
    276267{ 
    277 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    278268  struct pci_dev *s_bridge; 
    279 #else 
    280   unsigned char SIS_bus, SIS_devfn; 
    281 #endif 
    282269  u16 val; 
    283270 
     
    285272    return -ENODEV; 
    286273 
    287 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54)) 
    288274  if (! (s_bridge = pci_find_device( 
    289275                   PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, NULL))) 
    290276                 
    291 #else 
    292   if(pcibios_find_device( 
    293                 PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_503, 0, 
    294                 &SIS_bus, &SIS_devfn)) 
    295 #endif 
    296277    return -ENODEV; 
    297278 
  • lm-sensors/trunk/kernel/chips/thmc50.c

    r667 r704  
    3131#include "compat.h" 
    3232 
    33 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3433#include <linux/init.h> 
    35 #else 
    36 #define __init 
    37 #define __initdata 
    38 #endif 
    39  
    4034 
    4135/* Addresses to scan */ 
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r693 r704  
    4848#include "compat.h" 
    4949 
    50 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    5150#include <linux/init.h> 
    52 #else 
    53 #define __init 
    54 #define __initdata 
    55 #endif 
    5651 
    5752/* RT Table support #defined so we can take it out if it gets bothersome */ 
  • lm-sensors/trunk/kernel/sensors.c

    r667 r704  
    3434#include "compat.h" 
    3535 
    36 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    3736#include <linux/init.h> 
    38 #else 
    39 #define __init  
    40 #endif 
    4137 
    4238#ifdef MODULE 
     
    6359static struct ctl_table_header *sensors_entries[SENSORS_ENTRY_MAX]; 
    6460 
    65 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 
    6661static struct i2c_client *sensors_clients[SENSORS_ENTRY_MAX]; 
    6762static unsigned short sensors_inodes[SENSORS_ENTRY_MAX]; 
     
    6964static void sensors_fill_inode(struct inode *inode, int fill); 
    7065static void sensors_dir_fill_inode(struct inode *inode, int fill); 
    71 #endif 
    72 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 
     66#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,1) */ 
    7367 
    7468static ctl_table sysctl_table[] = { 
     
    184178  sensors_entries[id-256] = new_header; 
    185179 
    186 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 
    187180  sensors_clients[id-256] = client; 
    188181#ifdef DEBUG 
     
    201194  new_header->ctl_table->child->child->de->fill_inode = &sensors_dir_fill_inode; 
    202195#endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,27)) 
    203 #endif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 
    204196 
    205197  return id; 
     
    219211    kfree(table); 
    220212    sensors_entries[id] = NULL; 
    221 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 
    222213    sensors_clients[id] = NULL; 
    223 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 
    224   } 
    225 } 
    226  
    227 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 
     214  } 
     215} 
     216 
    228217/* Monitor access for /proc/sys/dev/sensors; make unloading sensors.o  
    229218   impossible if some process still uses it or some file in it */ 
     
    267256    client->driver->dec_use(client); 
    268257} 
    269 #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) */ 
    270258 
    271259int sensors_proc_chips(ctl_table *ctl, int write, struct file * filp, 
     
    778766#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) 
    779767  sensors_proc_header->ctl_table->child->de->owner = THIS_MODULE; 
    780 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,58)) 
     768#else 
    781769  sensors_proc_header->ctl_table->child->de->fill_inode = &sensors_fill_inode; 
    782770#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,1)) */