2002-06-24 04:04:32

by Frank Davis

[permalink] [raw]
Subject: [PATCH] 2.5.24 : drivers/scsi/gdth.c

Hello all,
This patch adds the DMA mapping checking code, and reduces some
redundancy. Please review.
Regards,
Frank

--- drivers/scsi/gdth.c.old Wed Feb 13 21:26:59 2002
+++ drivers/scsi/gdth.c Sun Jun 23 23:41:10 2002
@@ -827,10 +827,18 @@
TRACE(("gdth_search_dev() cnt %d vendor %x device %x\n",
*cnt, vendor, device));

-#if LINUX_VERSION_CODE >= 0x20363
+#if LINUX_VERSION_CODE >= 0x2015C
pdev = NULL;
while ((pdev = pci_find_device(vendor, device, pdev))
!= NULL) {
+ if(pci_set_dma_mask(pdev, 0xffffffff))
+ {
+ printk(KERN_WARNING "gdth : No suitable DMA available\n");
+ }
+
+#endif
+
+#if LINUX_VERSION_CODE >= 0x20363
if (pci_enable_device(pdev))
continue;
if (*cnt >= MAXHA)
@@ -866,11 +874,8 @@
(*cnt)++;
}
#elif LINUX_VERSION_CODE >= 0x2015C
- pdev = NULL;
- while ((pdev = pci_find_device(vendor, device, pdev))
- != NULL) {
- if (*cnt >= MAXHA)
- return;
+ if (*cnt >= MAXHA)
+ return;
/* GDT PCI controller found, resources are already in pdev */
pcistr[*cnt].pdev = pdev;
pcistr[*cnt].vendor_id = vendor;