@@ -832,37 +832,40 @@ static int adpt_hba_reset(adpt_hba* pHba)
pHba->state |= DPTI_STATE_RESET;
// Activate does get status , init outbound, and get hrt
- if ((rcode=adpt_i2o_activate_hba(pHba)) < 0) {
+ rcode = adpt_i2o_activate_hba(pHba);
+ if (rcode < 0) {
printk(KERN_ERR "%s: Could not activate\n", pHba->name);
- adpt_i2o_delete_hba(pHba);
- return rcode;
+ goto delete_hba;
}
- if ((rcode=adpt_i2o_build_sys_table()) < 0) {
- adpt_i2o_delete_hba(pHba);
- return rcode;
- }
+ rcode = adpt_i2o_build_sys_table();
+ if (rcode < 0)
+ goto delete_hba;
+
PDEBUG("%s: in HOLD state\n",pHba->name);
- if ((rcode=adpt_i2o_online_hba(pHba)) < 0) {
- adpt_i2o_delete_hba(pHba);
- return rcode;
- }
+ rcode = adpt_i2o_online_hba(pHba);
+ if (rcode < 0)
+ goto delete_hba;
+
PDEBUG("%s: in OPERATIONAL state\n",pHba->name);
- if ((rcode=adpt_i2o_lct_get(pHba)) < 0){
- adpt_i2o_delete_hba(pHba);
- return rcode;
- }
+ rcode = adpt_i2o_lct_get(pHba);
+ if (rcode < 0)
+ goto delete_hba;
+
+ rcode = adpt_i2o_reparse_lct(pHba);
+ if (rcode < 0)
+ goto delete_hba;
- if ((rcode=adpt_i2o_reparse_lct(pHba)) < 0){
- adpt_i2o_delete_hba(pHba);
- return rcode;
- }
pHba->state &= ~DPTI_STATE_RESET;
adpt_fail_posted_scbs(pHba);
return 0; /* return success */
+
+delete_hba:
+ adpt_i2o_delete_hba(pHba);
+ return rcode;
}
/*===========================================================================