Changeset 545

Show
Ignore:
Timestamp:
09/03/99 13:11:03 (14 years ago)
Author:
frodo
Message:

mkpatch updates

* mkpatch now correctly works when kernel-side files do not yet exist.

I forgot to propagate a change in the i2c version.

* init* handling in mkpatch and compat.h
* New i801 defines added to mkpatch

Location:
lm-sensors/trunk
Files:
3 modified

Legend:

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

    r537 r545  
    4141#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54)) 
    4242#include <linux/bios32.h> 
    43 #endif 
    44  
    45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
    46 #include <linux/init.h> 
    47 #else 
    48 #define __init 
    49 #define __initdata 
    5043#endif 
    5144 
  • lm-sensors/trunk/kernel/include/compat.h

    r531 r545  
    9494#endif 
    9595 
     96/* Including init.h should be safe, even if it is not used. */ 
     97#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
     98#include <linux/init.h> 
     99#else 
     100#define __init 
     101#define __initdata 
     102#endif 
     103 
    96104/* For old 2.0 kernels */ 
    97105#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,34)) 
  • lm-sensors/trunk/mkpatch/mkpatch.pl

    r518 r545  
    3232  my ($diff_command,$dummy); 
    3333 
    34   $diff_command = "diff -u2 $kernel_root/$kernel_file "; 
    35   $diff_command .= "$package_root/$package_file"; 
     34  $diff_command = "diff -u2"; 
     35  if ( -e "$kernel_root/$kernel_file") { 
     36    $diff_command .= " $kernel_root/$kernel_file "; 
     37  } else { 
     38    $diff_command .= " /dev/null "; 
     39  } 
     40  if ( -e "$package_root/$package_file") { 
     41    $diff_command .= " $package_root/$package_file "; 
     42  } else { 
     43    $diff_command .= " /dev/null"; 
     44  } 
    3645  open INPUT, "$diff_command|" or die "Can't execute `$diff_command'"; 
    3746  $dummy = <INPUT>; 
     
    531540#endif 
    532541EOF 
    533  
    534         } 
     542        } 
     543        if (`grep '__init' "$package_root/$package_file"`) { 
     544          print OUTPUT << 'EOF'; 
     545#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53) 
     546#include <linux/init.h> 
     547#else 
     548#define __init 
     549#define __initdata 
     550#endif 
     551EOF 
     552        } 
    535553        if (`grep 'PCI_DEVICE_ID_VIA_82C586_3' "$package_root/$package_file"`) { 
    536554          print OUTPUT << 'EOF'; 
     
    569587EOF 
    570588        } 
     589        if (`grep 'PCI_DEVICE_ID_INTEL_82801AA_3\|PCI_DEVICE_ID_INTEL_82801AB_3' "$package_root/$package_file"`) { 
     590          print OUTPUT << 'EOF'; 
     591#ifndef PCI_DEVICE_ID_INTEL_82801AA_3 
     592#define PCI_DEVICE_ID_INTEL_82801AA_3  0x2413 
     593#endif 
     594#ifndef PCI_DEVICE_ID_INTEL_82801AB_3 
     595#define PCI_DEVICE_ID_INTEL_82801AB_3  0x2423 
     596#endif 
     597EOF 
     598        } 
    571599        print OUTPUT << 'EOF'; 
     600 
    572601/* --> END OF COMPATIBILITY SECTION */ 
    573602