Changeset 563

Show
Ignore:
Timestamp:
09/13/99 22:55:49 (14 years ago)
Author:
frodo
Message:

Updates for 2.0.x kernel compilation

Most important change: GL518SM-rev00 can't use kernel threads on 2.0 and
early 2.1 kernels

Location:
lm-sensors/trunk
Files:
4 modified

Legend:

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

    r522 r563  
    2929 
    3030#include <linux/i2c.h> 
     31 
     32#include "compat.h" 
    3133 
    3234#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
  • lm-sensors/trunk/kernel/chips/gl518sm.c

    r522 r563  
    151151         struct semaphore update_lock; 
    152152 
    153          int iterate_lock, quit_thread; 
     153         int iterate_lock; 
     154#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
     155         int quit_thread; 
    154156         struct task_struct *thread; 
     157#endif 
    155158         struct wait_queue *wq; 
    156159          
     
    202205 
    203206static void gl518_update_client_rev00(struct i2c_client *client); 
     207#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    204208static int gl518_update_thread(void *data); 
     209#endif 
    205210static void gl518_update_iterate(struct i2c_client *client); 
    206211 
     
    390395  data->iterate = 0; 
    391396  data->iterate_lock = 0; 
     397#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    392398  data->quit_thread = 0; 
    393399  data->thread = NULL; 
     400#endif 
    394401  data->alarm_mask = 0xff; 
    395402  gl518_init_client((struct i2c_client *) new_client); 
     
    474481  gl518_list[i] = NULL; 
    475482   
     483#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    476484  if (data->thread) { 
    477485    data->quit_thread = 1; 
    478486    wake_up_interruptible(&data->wq); 
    479487  } 
     488#endif 
    480489 
    481490  kfree(client); 
     
    632641} 
    633642 
    634  
     643#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    635644int gl518_update_thread(void *c) 
    636645{ 
     
    671680  return 0; 
    672681} 
     682#endif 
    673683 
    674684/* This updates vdd, vin1, vin2 values by doing slow and multiple 
     
    710720      gl518_write_value(client, VIN_REG(i), max[i] << 8 | min[i]); 
    711721 
     722#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    712723    if ((data->thread) &&  
    713724       ((data->quit_thread) || signal_pending(current)))  
    714725      goto finish; 
     726#endif 
    715727 
    716728    /* we wait now 1.5 seconds before comparing */ 
     
    981993      data->valid=0; 
    982994       
     995#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,68) 
    983996      if ((data->iterate != 2) && (data->thread)) { 
    984997         data->quit_thread = 1; 
     
    9881001         kernel_thread(gl518_update_thread, (void*) client, 0); 
    9891002      } 
     1003#endif 
    9901004    } 
    9911005  } 
  • lm-sensors/trunk/kernel/include/compat.h

    r545 r563  
    3232#include <linux/module.h> 
    3333#ifndef MODULE_AUTHOR 
    34 #define MODULE_AUTHOR(whatever) 
     34#define MODULE_AUTHOR(noone) 
    3535#endif 
    3636#ifndef MODULE_DESCRIPTION 
    37 #define MODULE_DESCRIPTION(whatever) 
     37#define MODULE_DESCRIPTION(none) 
     38#endif 
     39#ifndef MODULE_PARM 
     40#define MODULE_PARM(no,param) 
     41#endif 
     42#ifndef MODULE_PARM_DESC 
     43#define MODULE_PARM_DES(no,description) 
    3844#endif 
    3945#endif /* def MODULE */ 
     46 
     47#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) 
     48#define EXPORT_SYMBOL(noexport) 
     49#define EXPORT_NO_SYMBOLS 
     50#endif 
    4051 
    4152/* copy_from/to_usr is called memcpy_from/to_fs in 2.0 kernels  
  • lm-sensors/trunk/mkpatch/mkpatch.pl

    r561 r563  
    700700#ifdef MODULE 
    701701#include <linux/module.h> 
     702#endif /* def MODULE */ 
    702703#ifndef MODULE_AUTHOR 
    703 #define MODULE_AUTHOR(whatever) 
     704#define MODULE_AUTHOR(noone) 
    704705#endif 
    705706#ifndef MODULE_DESCRIPTION 
    706 #define MODULE_DESCRIPTION(whatever) 
    707 #endif 
     707#define MODULE_DESCRIPTION(none) 
     708#endif 
     709#ifndef MODULE_PARM 
     710#define MODULE_PARM(no,param) 
     711#endif 
     712#ifndef MODULE_PARM_DESC 
     713#define MODULE_PARM_DESC(no,description) 
    708714#endif /* def MODULE */ 
    709715 
    710716EOF 
     717 
    711718        if (`grep KERNEL_VERSION "$package_root/$package_file"`) { 
    712719          print OUTPUT << 'EOF'; 
     
    714721#ifndef KERNEL_VERSION 
    715722#define KERNEL_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c)) 
     723#endif 
     724 
     725EOF 
     726        } 
     727        if (`grep EXPORT_NO_SYMBOLS "$package_root/$package_file"`) { 
     728          print OUTPUT << 'EOF'; 
     729#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) 
     730#define EXPORT_NO_SYMBOLS 
     731#endif 
     732 
     733EOF 
     734        } 
     735        if (`grep EXPORT_SYMBOL "$package_root/$package_file"`) { 
     736          print OUTPUT << 'EOF'; 
     737#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0) 
     738#define EXPORT_SYMBOL(noexport) 
    716739#endif 
    717740 
     
    773796EOF 
    774797        } 
    775         if (`grep 'ioremap\|iounmap' "$package_root/$package_file"`) { 
     798        if (`grep 'ioremap\\|iounmap' "$package_root/$package_file"`) { 
    776799          print OUTPUT  << 'EOF'; 
    777800/* I hope this is always correct, even for the PPC, but I really think so. 
     
    838861EOF 
    839862        } 
    840         if (`grep 'PCI_DEVICE_ID_INTEL_82801AA_3\|PCI_DEVICE_ID_INTEL_82801AB_3' "$package_root/$package_file"`) { 
     863        if (`grep 'PCI_DEVICE_ID_INTEL_82801AA_3\\|PCI_DEVICE_ID_INTEL_82801AB_3' "$package_root/$package_file"`) { 
    841864          print OUTPUT << 'EOF'; 
    842865#ifndef PCI_DEVICE_ID_INTEL_82801AA_3