Jeff Garzik <jgarzik@mandrakesoft.com> wrote:
> In 2.3.37, the PCI changes broke drivers/block/cy*693.c and
> drivers/pnp/isapnp.c at least, if not other modules. They are all
> looking for 'next' member...
>
> Would you consider adding a pci_device_next() helper to ease driver
> migration and future use?
Jeff,
I think you need pci_for_each_dev()
Here's the changes I made to the emu10k1 driver which should point
you in the right direction.
regards,
Dave.
--- main.c~ Fri Dec 17 09:19:06 1999
+++ main.c Fri Jan 7 14:04:41 2000
@@ -192,6 +192,7 @@
bus = pcidev->bus->number;
devfn = pcidev->devfn;
DPD("Function 0: devfn %x\n", devfn);
+#if LINUX_VERSION_CODE < 0x020337
pci_tmp = pcidev->next;
while (pci_tmp)
@@ -205,6 +206,18 @@
}
pci_tmp = pci_tmp->next;
}
+#else
+ pci_for_each_dev (pci_tmp) {
+ devfn1 = pci_tmp->devfn;
+ if (devfn1 == devfn + 1)
+ {
+ DPD("Function 1 exists: devfn %x\n", devfn1);
+ pcidev_joy = pci_tmp;
+ break;
+ }
+ }
+#endif
+
/* Device found - Query PCI BIOS info */
DPD("Emu10k1 device %d found!\n", index);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Jan 07 2000 - 21:00:09 EST