Commit 74d722c4 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] qla1280: cleanup qla1280_initialize_adapter

no function changes, just some more gotos and less nested ifs to make
the code readable.
Signed-off-by: default avatarJes Sorensen <jes@wildopensource.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent b0208f1f
...@@ -1812,36 +1812,24 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha) ...@@ -1812,36 +1812,24 @@ qla1280_initialize_adapter(struct scsi_qla_host *ha)
dprintk(1, "scsi(%ld): Configure NVRAM parameters\n", ha->host_no); dprintk(1, "scsi(%ld): Configure NVRAM parameters\n", ha->host_no);
qla1280_nvram_config(ha); qla1280_nvram_config(ha);
if (!ha->flags.disable_host_adapter && !qla1280_init_rings(ha)) { if (ha->flags.disable_host_adapter) {
/* Issue SCSI reset. */ status = 1;
/* dg 03/13 if we can't reset twice then bus is dead */ goto out;
for (bus = 0; bus < ha->ports; bus++) {
if (!ha->bus_settings[bus].disable_scsi_reset){
if (qla1280_bus_reset(ha, bus)) {
if (qla1280_bus_reset(ha, bus)) {
ha->bus_settings[bus].scsi_bus_dead = 1;
}
}
}
} }
/* status = qla1280_init_rings(ha);
* qla1280_bus_reset() will take care of issueing markers, if (status)
* no need to do that here as well! goto out;
*/
#if 0 /* Issue SCSI reset, if we can't reset twice then bus is dead */
/* Issue marker command. */
ha->flags.reset_marker = 0;
for (bus = 0; bus < ha->ports; bus++) { for (bus = 0; bus < ha->ports; bus++) {
ha->bus_settings[bus].reset_marker = 0; if (!ha->bus_settings[bus].disable_scsi_reset &&
qla1280_marker(ha, bus, 0, 0, MK_SYNC_ALL); qla1280_bus_reset(ha, bus) &&
qla1280_bus_reset(ha, bus))
ha->bus_settings[bus].scsi_bus_dead = 1;
} }
#endif
ha->flags.online = 1; ha->flags.online = 1;
} else
status = 1;
out: out:
#if LINUX_VERSION_CODE >= 0x020500 #if LINUX_VERSION_CODE >= 0x020500
spin_unlock_irqrestore(HOST_LOCK, flags); spin_unlock_irqrestore(HOST_LOCK, flags);
......
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