pci_for_each_device fix for 2.6 from Bernd Porr
authorFrank Mori Hess <fmhess@speakeasy.net>
Sat, 24 Jan 2004 16:56:48 +0000 (16:56 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Sat, 24 Jan 2004 16:56:48 +0000 (16:56 +0000)
include/linux/pci.h

index a71891bcd80ecf624c3c2e30933462072133c1fa..600ae0b3135764650978760d3a38a91ad78ffa57 100644 (file)
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
 /* we should get rid of this, as it has been dropped from 2.6 */
-#define pci_for_each_dev(x)    \
-       for((x) = pci_dev_g(pci_devices.next), prefetch((x)->global_list.next); \
-               x->global_list.next != &pci_devices; (x) = pci_dev_g((x)->global_list.next), \
-               prefetch((x)->global_list.next))
+#define pci_for_each_dev(x) \
+       for((x) = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,NULL); \
+               (x); \
+               (x) = pci_find_device(PCI_ANY_ID,PCI_ANY_ID,(x)))
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) /* XXX */