Re: [PATCH] More PCI fixes for 2.5.70

Greg KH (greg@kroah.com)
Thu, 5 Jun 2003 14:01:17 -0700


ChangeSet 1.1313, 2003/06/05 12:03:52-07:00, greg@kroah.com

[PATCH] PCI: fix up previous fusion driver pci changes

This makes the driver build properly now, and removes a direct access
of the pci_devices variable.

drivers/message/fusion/linux_compat.h | 7 ++-----
drivers/message/fusion/mptbase.c | 2 +-
2 files changed, 3 insertions(+), 6 deletions(-)

diff -Nru a/drivers/message/fusion/linux_compat.h b/drivers/message/fusion/linux_compat.h
--- a/drivers/message/fusion/linux_compat.h Thu Jun 5 13:53:01 2003
+++ b/drivers/message/fusion/linux_compat.h Thu Jun 5 13:53:01 2003
@@ -147,9 +147,7 @@


/* PCI/driver subsystem { */
-#ifndef pci_for_each_dev
-#define pci_for_each_dev(dev) for((dev)=pci_devices; (dev)!=NULL; (dev)=(dev)->next)
-#define pci_peek_next_dev(dev) ((dev)->next ? (dev)->next : NULL)
+#if 0 /* FIXME Don't know what to use to check for the proper kernel version */
#define DEVICE_COUNT_RESOURCE 6
#define PCI_BASEADDR_FLAGS(idx) base_address[idx]
#define PCI_BASEADDR_START(idx) base_address[idx] & ~0xFUL
@@ -169,11 +167,10 @@
(4 - size); \
})
#else
-#define pci_peek_next_dev(dev) ((dev) != pci_dev_g(&pci_devices) ? pci_dev_g((dev)->global_list.next) : NULL)
#define PCI_BASEADDR_FLAGS(idx) resource[idx].flags
#define PCI_BASEADDR_START(idx) resource[idx].start
#define PCI_BASEADDR_SIZE(dev,idx) (dev)->resource[idx].end - (dev)->resource[idx].start + 1
-#endif /* } ifndef pci_for_each_dev */
+#endif /* } ifndef 0 */


/* Compatability for the 2.3.x PCI DMA API. */
diff -Nru a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
--- a/drivers/message/fusion/mptbase.c Thu Jun 5 13:53:01 2003
+++ b/drivers/message/fusion/mptbase.c Thu Jun 5 13:53:01 2003
@@ -1184,7 +1184,7 @@
* Do some kind of look ahead here...
*/
if (pdev->devfn & 1) {
- pdev2 = pci_peek_next_dev(pdev);
+ pdev2 = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, pdev);
if (pdev2 && (pdev2->vendor == 0x1000) &&
(PCI_SLOT(pdev2->devfn) == PCI_SLOT(pdev->devfn)) &&
(pdev2->device == pdev->device) &&

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/