From: Ian Abbott Date: Mon, 7 Aug 2006 18:01:40 +0000 (+0000) Subject: Add compatibility function pci_name(pci_dev) for kernel < 2.4.22. It X-Git-Tag: r0_7_72~19 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c4dd64c517de588bdc352b0379ed05a10a526ea4;p=comedi.git 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). --- 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 */