@@ -6244,7 +6244,7 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct fc_rport *rport,
62446244/**
62456245 * lpfc_chk_tgt_mapped -
62466246 * @vport: The virtual port to check on
6247- * @cmnd : Pointer to scsi_cmnd data structure.
6247+ * @rport : Pointer to fc_rport data structure.
62486248 *
62496249 * This routine delays until the scsi target (aka rport) for the
62506250 * command exists (is present and logged in) or we declare it non-existent.
@@ -6254,19 +6254,20 @@ lpfc_send_taskmgmt(struct lpfc_vport *vport, struct fc_rport *rport,
62546254 * 0x2002 - Success
62556255 **/
62566256static int
6257- lpfc_chk_tgt_mapped (struct lpfc_vport * vport , struct scsi_cmnd * cmnd )
6257+ lpfc_chk_tgt_mapped (struct lpfc_vport * vport , struct fc_rport * rport )
62586258{
62596259 struct lpfc_rport_data * rdata ;
6260- struct lpfc_nodelist * pnode ;
6260+ struct lpfc_nodelist * pnode = NULL ;
62616261 unsigned long later ;
62626262
6263- rdata = lpfc_rport_data_from_scsi_device ( cmnd -> device ) ;
6263+ rdata = rport -> dd_data ;
62646264 if (!rdata ) {
62656265 lpfc_printf_vlog (vport , KERN_INFO , LOG_FCP ,
62666266 "0797 Tgt Map rport failure: rdata x%px\n" , rdata );
62676267 return FAILED ;
62686268 }
62696269 pnode = rdata -> pnode ;
6270+
62706271 /*
62716272 * If target is not in a MAPPED state, delay until
62726273 * target is rediscovered or devloss timeout expires.
@@ -6278,7 +6279,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct scsi_cmnd *cmnd)
62786279 if (pnode -> nlp_state == NLP_STE_MAPPED_NODE )
62796280 return SUCCESS ;
62806281 schedule_timeout_uninterruptible (msecs_to_jiffies (500 ));
6281- rdata = lpfc_rport_data_from_scsi_device ( cmnd -> device ) ;
6282+ rdata = rport -> dd_data ;
62826283 if (!rdata )
62836284 return FAILED ;
62846285 pnode = rdata -> pnode ;
@@ -6371,7 +6372,7 @@ lpfc_device_reset_handler(struct scsi_cmnd *cmnd)
63716372 if (status != 0 && status != SUCCESS )
63726373 return status ;
63736374
6374- status = lpfc_chk_tgt_mapped (vport , cmnd );
6375+ status = lpfc_chk_tgt_mapped (vport , rport );
63756376 if (status == FAILED ) {
63766377 lpfc_printf_vlog (vport , KERN_ERR , LOG_TRACE_EVENT ,
63776378 "0721 Device Reset rport failure: rdata x%px\n" , rdata );
@@ -6449,7 +6450,7 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd)
64496450 if (status != 0 && status != SUCCESS )
64506451 return status ;
64516452
6452- status = lpfc_chk_tgt_mapped (vport , cmnd );
6453+ status = lpfc_chk_tgt_mapped (vport , rport );
64536454 if (status == FAILED ) {
64546455 lpfc_printf_vlog (vport , KERN_ERR , LOG_TRACE_EVENT ,
64556456 "0722 Target Reset rport failure: rdata x%px\n" , rdata );
0 commit comments