return FALSE;
#ifdef PORT_OVERRIDE
- if(check_region(PORT_OVERRIDE, 0xc)) {
+ if(!request_region(PORT_OVERRIDE, 0xc, "ultrastor")) {
printk("Ultrastor I/O space already in use\n");
return FALSE;
};
config.port_address = PORT_OVERRIDE;
#else
for (i = 0; i < ARRAY_SIZE(ultrastor_ports_14f); i++) {
- if(check_region(ultrastor_ports_14f[i], 0x0c)) continue;
+ if(!request_region(ultrastor_ports_14f[i], 0x0c, "ultrastor")) continue;
config.port_address = ultrastor_ports_14f[i];
#endif
# endif
#endif
#ifdef PORT_OVERRIDE
- return FALSE;
+ goto out_release_port;
#else
+ release_region(config.port_address, 0x0c);
continue;
#endif
}
# endif
#endif
#ifdef PORT_OVERRIDE
- return FALSE;
+ goto out_release_port;
#else
+ release_region(config.port_address, 0x0c);
continue;
#endif
}
# if (ULTRASTOR_DEBUG & UD_DETECT)
printk("US14F: detect: no port address found!\n");
# endif
+ /* all ports probed already released - we can just go straight out */
return FALSE;
}
#endif
/* All above tests passed, must be the right thing. Get some useful
info. */
- request_region(config.port_address, 0x0c,"ultrastor");
/* Register the I/O space that we use */
*(char *)&config_1 = inb(CONFIG(config.port_address + 0));
#if (ULTRASTOR_DEBUG & UD_DETECT)
printk("US14F: detect: not detected.\n");
#endif
- return FALSE;
+ goto out_release_port;
}
/* Final consistency check, verify previous info. */
#if (ULTRASTOR_DEBUG & UD_DETECT)
printk("US14F: detect: consistency check failed\n");
#endif
- return FALSE;
+ goto out_release_port;
}
/* If we were TRULY paranoid, we could issue a host adapter inquiry
if (request_irq(config.interrupt, do_ultrastor_interrupt, 0, "Ultrastor", &config.mscp[0].SCint->host)) {
printk("Unable to allocate IRQ%u for UltraStor controller.\n",
config.interrupt);
- return FALSE;
+ goto out_release_port;
}
if (config.dma_channel && request_dma(config.dma_channel,"Ultrastor")) {
printk("Unable to allocate DMA channel %u for UltraStor controller.\n",
config.dma_channel);
free_irq(config.interrupt, NULL);
- return FALSE;
+ goto out_release_port;
}
tpnt->sg_tablesize = ULTRASTOR_14F_MAX_SG;
printk("UltraStor driver version" VERSION ". Using %d SG lists.\n",
ULTRASTOR_14F_MAX_SG);
return TRUE;
+out_release_port:
+ release_region(config.port_address, 0x0c);
+ return FALSE;
}
static int ultrastor_24f_detect(Scsi_Host_Template * tpnt)