From c4dd64c517de588bdc352b0379ed05a10a526ea4 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 7 Aug 2006 18:01:40 +0000 Subject: [PATCH] Add compatibility function pci_name(pci_dev) for kernel < 2.4.22. It 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/linux/pci.h b/include/linux/pci.h index 19e71e42..39f1639b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -16,6 +16,13 @@ #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 */ -- 2.26.2