Index: include/linux/pci.h
===================================================================
RCS file: /var/cvs/comedi/include/linux/pci.h,v
retrieving revision 1.26
diff -u -r1.26 pci.h
--- include/linux/pci.h	22 Jan 2005 14:22:20 -0000	1.26
+++ include/linux/pci.h	18 Feb 2005 18:05:30 -0000
@@ -142,15 +142,42 @@
 	}
 }
 
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,15) || LINUX_VERSION_CODE > KERNEL_VERSION(2,6,9)
 static inline struct pci_dev* pci_find_subsys( unsigned int vendor, unsigned int device,
 	unsigned int ss_vendor, unsigned int ss_device,
 	const struct pci_dev *from)
 {
-	rt_printk( "pci_find_subsys() not supported in kernels older than 2.4!\n" );
-	return NULL;
-}
+	struct pci_dev *dev = (struct pci_dev *)from;	/* ignore const */
 
-#endif
+	while((dev=pci_find_device(vendor,device,dev))!=NULL){
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,15)
+		if(ss_vendor!=PCI_ANY_ID){
+			u16 temp;
+			pci_read_config_word(dev,PCI_SUBSYSTEM_VENDOR_ID,&temp);
+			if(ss_vendor!=temp){
+				continue;
+			}
+		}
+		if(ss_device!=PCI_ANY_ID){
+			u16 temp;
+			pci_read_config_word(dev,PCI_SUBSYSTEM_ID,&temp);
+			if(ss_device!=temp){
+				continue;
+			}
+		}
+		break;	/* match */
+#else
+		if((ss_vendor==PCI_ANY_ID || ss_vendor==dev->subsystem_vendor) &&
+		   (ss_device==PCI_ANY_ID || ss_device==dev->subsystem_device)){
+			break;	/* match */
+		}
+#endif	// 2.3.15
+	}
+	return dev;
+}
+#endif	// <2.3.15 || >2.6.9
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,14)
 static inline void pci_set_master(struct pci_dev *dev)

