Commit c349cff2 authored by Alan Cox's avatar Alan Cox Committed by Steve French

[PATCH] Fix remaining g_NCR5380 use of check_region

parent de69a1ad
...@@ -386,14 +386,21 @@ int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt) ...@@ -386,14 +386,21 @@ int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt)
if (overrides[current_override].NCR5380_map_name != PORT_AUTO) if (overrides[current_override].NCR5380_map_name != PORT_AUTO)
for (i = 0; ports[i]; i++) { for (i = 0; ports[i]; i++) {
if (!request_region(ports[i], 16, "ncr53c80"))
continue;
if (overrides[current_override].NCR5380_map_name == ports[i]) if (overrides[current_override].NCR5380_map_name == ports[i])
break; break;
release_region(ports[i], 16);
} else } else
for (i = 0; ports[i]; i++) { 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; break;
release_region(ports[i], 16);
} }
if (ports[i]) { if (ports[i]) {
/* At this point we have our region reserved */
outb(0x59, 0x779); outb(0x59, 0x779);
outb(0xb9, 0x379); outb(0xb9, 0x379);
outb(0xc5, 0x379); outb(0xc5, 0x379);
...@@ -408,12 +415,15 @@ int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt) ...@@ -408,12 +415,15 @@ int __init generic_NCR5380_detect(Scsi_Host_Template * tpnt)
} else } else
continue; continue;
} }
else
request_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380"); {
/* Not a 53C400A style setup - just grab */
if(!(request_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380")))
continue;
}
#else #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; continue;
request_mem_region(overrides[current_override].NCR5380_map_name, NCR5380_region_size, "ncr5380");
#endif #endif
instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata)); instance = scsi_register(tpnt, sizeof(struct NCR5380_hostdata));
if (instance == NULL) { if (instance == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment