From: Hannes Reinecke Date: Tue, 14 Jan 2014 09:26:25 +0000 (+0100) Subject: [SCSI] bfa: set correct command return code X-Git-Tag: v5.15~18194^2~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c60b7b121da1db780197914b45b6ed6f63c52ac5;p=platform%2Fkernel%2Flinux-starfive.git [SCSI] bfa: set correct command return code For various error conditions the bfa driver just returns 'DID_ERROR', which carries no information at all about the actual source of error. This patch updates the error handling to return a correct error code, depending on the type of error occurred. Signed-off-by: Hannes Reinecke Acked-by: Vijaya Mohan Guvva Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/bfa/bfad_im.c b/drivers/scsi/bfa/bfad_im.c index 9967f9c..f067332 100644 --- a/drivers/scsi/bfa/bfad_im.c +++ b/drivers/scsi/bfa/bfad_im.c @@ -73,9 +73,14 @@ bfa_cb_ioim_done(void *drv, struct bfad_ioim_s *dio, break; - case BFI_IOIM_STS_ABORTED: case BFI_IOIM_STS_TIMEDOUT: + host_status = DID_TIME_OUT; + cmnd->result = ScsiResult(host_status, 0); + break; case BFI_IOIM_STS_PATHTOV: + host_status = DID_TRANSPORT_DISRUPTED; + cmnd->result = ScsiResult(host_status, 0); + break; default: host_status = DID_ERROR; cmnd->result = ScsiResult(host_status, 0);