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


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@545 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Frodo Looijaard committed 1999-09-03 11:11:03 +00:00
1 parent d00f2e005d
commit d1e26d5f16
3 files changed
+40 -10

No files matched your search

-7
View File
@@ -42,13 +42,6 @@
#include <linux/bios32.h>
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* I801 SMBus address offsets */
#define SMBHSTSTS (0 + i801_smba)
#define SMBHSTCNT (2 + i801_smba)
+8
View File
@@ -93,6 +93,14 @@
#define init_MUTEX(s) do { *(s) = MUTEX; } while(0)
#endif
/* Including init.h should be safe, even if it is not used. */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
/* For old 2.0 kernels */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,34))
#define PCI_DEVICE_ID_VIA_82C586_3 0x3040
+32 -3
View File
@@ -31,8 +31,17 @@ sub print_diff
my ($package_root,$kernel_root,$kernel_file,$package_file) = @_;
my ($diff_command,$dummy);
$diff_command = "diff -u2 $kernel_root/$kernel_file ";
$diff_command .= "$package_root/$package_file";
$diff_command = "diff -u2";
if ( -e "$kernel_root/$kernel_file") {
$diff_command .= " $kernel_root/$kernel_file ";
} else {
$diff_command .= " /dev/null ";
}
if ( -e "$package_root/$package_file") {
$diff_command .= " $package_root/$package_file ";
} else {
$diff_command .= " /dev/null";
}
open INPUT, "$diff_command|" or die "Can't execute `$diff_command'";
$dummy = <INPUT>;
$dummy = <INPUT>;
@@ -530,8 +539,17 @@ EOF
#define init_MUTEX(s) do { *(s) = MUTEX; } while(0)
#endif
EOF
}
if (`grep '__init' "$package_root/$package_file"`) {
print OUTPUT << 'EOF';
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,53)
#include <linux/init.h>
#else
#define __init
#define __initdata
#endif
EOF
}
if (`grep 'PCI_DEVICE_ID_VIA_82C586_3' "$package_root/$package_file"`) {
print OUTPUT << 'EOF';
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,34))
@@ -566,9 +584,20 @@ EOF
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,0,31))
#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
#endif
EOF
}
if (`grep 'PCI_DEVICE_ID_INTEL_82801AA_3\|PCI_DEVICE_ID_INTEL_82801AB_3' "$package_root/$package_file"`) {
print OUTPUT << 'EOF';
#ifndef PCI_DEVICE_ID_INTEL_82801AA_3
#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
#endif
#ifndef PCI_DEVICE_ID_INTEL_82801AB_3
#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423
#endif
EOF
}
print OUTPUT << 'EOF';
/* --> END OF COMPATIBILITY SECTION */
EOF