@@ -1392,7 +1392,7 @@ static void do_reset(struct Scsi_Host *instance)
1392
1392
* MESSAGE OUT phase and sending an ABORT message.
1393
1393
* @instance: relevant scsi host instance
1394
1394
*
1395
- * Returns 0 on success, -1 on failure.
1395
+ * Returns 0 on success, negative error code on failure.
1396
1396
*/
1397
1397
1398
1398
static int do_abort (struct Scsi_Host * instance )
@@ -1417,7 +1417,7 @@ static int do_abort(struct Scsi_Host *instance)
1417
1417
1418
1418
rc = NCR5380_poll_politely (hostdata , STATUS_REG , SR_REQ , SR_REQ , 10 * HZ );
1419
1419
if (rc < 0 )
1420
- goto timeout ;
1420
+ goto out ;
1421
1421
1422
1422
tmp = NCR5380_read (STATUS_REG ) & PHASE_MASK ;
1423
1423
@@ -1428,7 +1428,7 @@ static int do_abort(struct Scsi_Host *instance)
1428
1428
ICR_BASE | ICR_ASSERT_ATN | ICR_ASSERT_ACK );
1429
1429
rc = NCR5380_poll_politely (hostdata , STATUS_REG , SR_REQ , 0 , 3 * HZ );
1430
1430
if (rc < 0 )
1431
- goto timeout ;
1431
+ goto out ;
1432
1432
NCR5380_write (INITIATOR_COMMAND_REG , ICR_BASE | ICR_ASSERT_ATN );
1433
1433
}
1434
1434
@@ -1437,17 +1437,17 @@ static int do_abort(struct Scsi_Host *instance)
1437
1437
len = 1 ;
1438
1438
phase = PHASE_MSGOUT ;
1439
1439
NCR5380_transfer_pio (instance , & phase , & len , & msgptr );
1440
+ if (len )
1441
+ rc = - ENXIO ;
1440
1442
1441
1443
/*
1442
1444
* If we got here, and the command completed successfully,
1443
1445
* we're about to go into bus free state.
1444
1446
*/
1445
1447
1446
- return len ? -1 : 0 ;
1447
-
1448
- timeout :
1448
+ out :
1449
1449
NCR5380_write (INITIATOR_COMMAND_REG , ICR_BASE );
1450
- return -1 ;
1450
+ return rc ;
1451
1451
}
1452
1452
1453
1453
/*
@@ -2279,7 +2279,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
2279
2279
dsprintk (NDEBUG_ABORT , instance , "abort: cmd %p is connected\n" , cmd );
2280
2280
hostdata -> connected = NULL ;
2281
2281
hostdata -> dma_len = 0 ;
2282
- if (do_abort (instance )) {
2282
+ if (do_abort (instance ) < 0 ) {
2283
2283
set_host_byte (cmd , DID_ERROR );
2284
2284
complete_cmd (instance , cmd );
2285
2285
result = FAILED ;
0 commit comments