* PATCH: Fix remaining g_NCR5380 use of check_region
@ 2003-07-11 18:07 Alan Cox
0 siblings, 0 replies; only message in thread
From: Alan Cox @ 2003-07-11 18:07 UTC (permalink / raw)
To: linux-kernel, torvalds
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux-2.5.75/drivers/scsi/g_NCR5380.c linux-2.5.75-ac1/drivers/scsi/g_NCR5380.c
--- linux-2.5.75/drivers/scsi/g_NCR5380.c 2003-07-10 21:05:35.000000000 +0100
+++ linux-2.5.75-ac1/drivers/scsi/g_NCR5380.c 2003-07-11 15:44:06.000000000 +0100
@@ -386,14 +386,21 @@
if (overrides[current_override].NCR5380_map_name != PORT_AUTO)
for (i = 0; ports[i]; i++) {
+ if (!request_region(ports[i], 16, "ncr53c80"))
+ continue;
if (overrides[current_override].NCR5380_map_name == ports[i])
break;
+ release_region(ports[i], 16);
} else
for (i = 0; ports[i]; i++) {
- if ((!check_region(ports[i], 16)) && (inb(ports[i]) == 0xff))
+ if (!request_region(ports[i], 16, "ncr53c80"))
+ continue;
+ if (inb(ports[i]) == 0xff)
break;
+ release_region(ports[i], 16);
}
if (ports[i]) {
+ /* At this point we have our region reserved */
outb(0x59, 0x779);
outb(0xb9, 0x379);
outb(0xc5, 0x379);
@@ -408,12 +415,15 @@
} else
continue;
}
-
- request_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380");
+ else
+ {
+ /* Not a 53C400A style setup - just grab */
+ if(!(request_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380")))
+ continue;
+ }
#else
- if (check_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size))
+ if(!request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380"))
continue;
- request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380");
#endif
instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
if (instance == NULL) {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-07-11 18:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-11 18:07 PATCH: Fix remaining g_NCR5380 use of check_region Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).