compatibility code for pci_get_bus_and_slot()
authorAlan Hourihane <alanh@tungstengraphics.com>
Tue, 19 Feb 2008 15:32:00 +0000 (15:32 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Wed, 20 Feb 2008 19:55:14 +0000 (19:55 +0000)
linux-core/drm_compat.c
linux-core/drm_compat.h

index cd4ff7d..e95269e 100644 (file)
@@ -764,3 +764,18 @@ unsigned long round_jiffies_relative(unsigned long j)
 }
 EXPORT_SYMBOL(round_jiffies_relative);
 #endif
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
+struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn)
+{
+    struct pci_dev *dev = NULL;
+
+    while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+        if (pci_domain_nr(dev->bus) == 0 &&
+           (dev->bus->number == bus && dev->devfn == devfn))
+            return dev;
+   }
+   return NULL;
+}
+EXPORT_SYMBOL(pci_get_bus_and_slot);
+#endif
index 92dcbc2..7854576 100644 (file)
@@ -335,4 +335,8 @@ void *idr_replace(struct idr *idp, void *ptr, int id);
 extern unsigned long round_jiffies_relative(unsigned long j);
 #endif
 
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
+extern struct pci_dev * pci_get_bus_and_slot(unsigned int bus, unsigned int devfn);
+#endif
+
 #endif