From e6ba14f1bf29fde50c575662167ac8179c432c74 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 5 Jun 2006 07:55:07 +0000 Subject: [PATCH] i2c-viapro.c: Move definition of PCI IDs before they are used. This fixes compilation with old kernels (2.4.20 and earlier). Thanks to Yuan Mu for reporting. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4039 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/busses/i2c-viapro.c | 25 +++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 50d8aa30..8f68f160 100644 --- a/CHANGES +++ b/CHANGES @@ -15,6 +15,7 @@ lm_sensors CHANGES file Module i2c-i801: Disable PEC mode after every transaction (2.6 backport) Add ICH8 support (2.6 backport) Module i2c-piix4: Add ServerWorks HT-1000 support (2.6 backport) + Module i2c-viapro: Fix compilation with kernels < 2.4.21 Module w83781d: Use real-time alarm registers when possible (2.6 backport) Program decode-dimms.pl: Decode depending on the memory type Decode the manufacturing date to an ISO8601 date diff --git a/kernel/busses/i2c-viapro.c b/kernel/busses/i2c-viapro.c index f911f1c7..2739eda5 100644 --- a/kernel/busses/i2c-viapro.c +++ b/kernel/busses/i2c-viapro.c @@ -49,6 +49,19 @@ #include "version.h" #include "sensors_compat.h" +/* 8233A is undefined before kernel 2.4.19 */ +#ifndef PCI_DEVICE_ID_VIA_8233A +#define PCI_DEVICE_ID_VIA_8233A 0x3147 +#endif +/* 8235 is undefined before kernel 2.4.21 */ +#ifndef PCI_DEVICE_ID_VIA_8235 +#define PCI_DEVICE_ID_VIA_8235 0x3177 +#endif +/* 8237 is undefined before kernel 2.4.21 */ +#ifndef PCI_DEVICE_ID_VIA_8237 +#define PCI_DEVICE_ID_VIA_8237 0x3227 +#endif + #define SMBBA1 0x90 #define SMBBA2 0x80 #define SMBBA3 0xD0 @@ -420,18 +433,6 @@ release_region: return error; } -/* 8233A is undefined before kernel 2.4.19 */ -#ifndef PCI_DEVICE_ID_VIA_8233A -#define PCI_DEVICE_ID_VIA_8233A 0x3147 -#endif -/* 8235 is undefined before kernel 2.4.20 */ -#ifndef PCI_DEVICE_ID_VIA_8235 -#define PCI_DEVICE_ID_VIA_8235 0x3177 -#endif -/* 8237 is undefined before kernel 2.4.21 */ -#ifndef PCI_DEVICE_ID_VIA_8237 -#define PCI_DEVICE_ID_VIA_8237 0x3227 -#endif static struct pci_device_id vt596_ids[] __initdata = { { .vendor = PCI_VENDOR_ID_VIA,