From 6b510ea0081dfb797c62a9b8856e6e6e77d265a7 Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Sat, 5 Dec 1998 01:03:03 +0000 Subject: [PATCH] Last fixes in piix4.o * Cleanup bug (ioports were not deregistered) * PIIX4 search (it seems that for function 3, we must seek for a slightly different device, too). git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@35 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-piix4.c | 9 +++++---- src/piix4.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/kernel/busses/i2c-piix4.c b/kernel/busses/i2c-piix4.c index 86162648..8aa06bbb 100644 --- a/kernel/busses/i2c-piix4.c +++ b/kernel/busses/i2c-piix4.c @@ -109,16 +109,17 @@ int piix4_setup(void) PIIX4_dev = NULL; do PIIX4_dev = pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82371AB_0, PIIX4_dev); + PCI_DEVICE_ID_INTEL_82371AB_3, PIIX4_dev); while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3); if(PIIX4_dev == NULL) { #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ for (i = 0; ! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82371AB_0, + PCI_DEVICE_ID_INTEL_82371AB_3, i,&PIIX4_bus, &PIIX4_devfn)) && PCI_FUNC(PIIX4_devfn) != 3; i++); + if (res) { #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ printk("piix4.o: Error: Can't detect PIIX4, function 3!\n"); @@ -399,11 +400,11 @@ int piix4_cleanup(void) printk("piix4.o: smbus_del_adapter failed, module not removed\n"); return res; } else - piix4_initialized=0; + piix4_initialized--; } if (piix4_initialized >= 1) { release_region(piix4_smba, 8); - piix4_initialized=0; + piix4_initialized--; } return 0; } diff --git a/src/piix4.c b/src/piix4.c index 86162648..8aa06bbb 100644 --- a/src/piix4.c +++ b/src/piix4.c @@ -109,16 +109,17 @@ int piix4_setup(void) PIIX4_dev = NULL; do PIIX4_dev = pci_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82371AB_0, PIIX4_dev); + PCI_DEVICE_ID_INTEL_82371AB_3, PIIX4_dev); while(PIIX4_dev && (PCI_FUNC(PIIX4_dev->devfn) != 3); if(PIIX4_dev == NULL) { #else /* LINUX_VERSION_CODE < KERNEL_VERSION(2,1,54) */ for (i = 0; ! (res = pcibios_find_device(PCI_VENDOR_ID_INTEL, - PCI_DEVICE_ID_INTEL_82371AB_0, + PCI_DEVICE_ID_INTEL_82371AB_3, i,&PIIX4_bus, &PIIX4_devfn)) && PCI_FUNC(PIIX4_devfn) != 3; i++); + if (res) { #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,54) */ printk("piix4.o: Error: Can't detect PIIX4, function 3!\n"); @@ -399,11 +400,11 @@ int piix4_cleanup(void) printk("piix4.o: smbus_del_adapter failed, module not removed\n"); return res; } else - piix4_initialized=0; + piix4_initialized--; } if (piix4_initialized >= 1) { release_region(piix4_smba, 8); - piix4_initialized=0; + piix4_initialized--; } return 0; }