Add compatibility function pci_name(pci_dev) for kernel < 2.4.22. It
authorIan Abbott <abbotti@mev.co.uk>
Mon, 7 Aug 2006 18:01:40 +0000 (18:01 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Mon, 7 Aug 2006 18:01:40 +0000 (18:01 +0000)
returns the pci device name as a char * (e.g. "00:09.0" for bus 0, slot 9,
func 0, or "0000:00:09.0" for recent kernels that include the PCI domain
in the string).

include/linux/pci.h

index 19e71e42456aa733a27c49c5bdee0864cc1341ee..39f1639b3778e8e70d6613a96c260a3d389cf4cc 100644 (file)
 #define pci_dev_put(x)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,22)
+static inline char *pci_name(struct pci_dev *pdev)
+{
+       return pdev->slot_name;
+}
+#endif
+
 #endif /* _COMPAT_PCI_H */