"qla1280", ha)) {
printk("qla1280 : Failed to reserve interrupt %d already "
"in use\n", host->irq);
- goto error_mem_alloced;
+ goto error_unmap;
}
#if !MEMORY_MAPPED_IO
/* Register the I/O space with Linux */
- if (check_region(host->io_port, 0xff)) {
+ if (!request_region(host->io_port, 0xff, "qla1280")) {
printk("qla1280 : Failed to reserve i/o region 0x%04lx-0x%04lx"
" already in use\n",
host->io_port, host->io_port + 0xff);
- free_irq(host->irq, ha);
- goto error_mem_alloced;
+ goto error_irq;
}
- request_region(host->io_port, 0xff, "qla1280");
#endif
reg = ha->iobase;
/* load the F/W, read paramaters, and init the H/W */
if (qla1280_initialize_adapter(ha)) {
printk(KERN_INFO "qla1x160:Failed to initialize adapter\n");
- goto error_mem_alloced;
+ goto error_region;
}
/* set our host ID (need to do something about our two IDs) */
return host;
+ error_region:
+#if !MEMORY_MAPPED_IO
+ release_region(host->io_port, 0xff);
+#endif
+
+ error_irq:
+ free_irq(host->irq, ha);
+
+ error_unmap:
+#if MEMORY_MAPPED_IO
+ if (ha->mmpbase)
+ iounmap((void *)(((unsigned long) ha->mmpbase) & PAGE_MASK));
+#endif
+
+
error_mem_alloced:
qla1280_mem_free(ha);