diff options
author | Brian King <brking@us.ibm.com> | 2006-11-20 14:51:56 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-11-28 03:51:55 -0500 |
commit | 08475a1920aa7acc535324d6991b830fa7625bd8 (patch) | |
tree | 12ec45ed05da376bac8205f31cb3c48fe35cd4aa /drivers/ata/libata-scsi.c | |
parent | f33d625f40e3b803c4cdea3219abb96cabf5ea03 (diff) |
[PATCH] libata: Fixup ata_sas_queuecmd to handle __ata_scsi_queuecmd failure
Fixes ata_sas_queuecmd to properly handle a failure from
__ata_scsi_queuecmd.
Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-scsi.c')
-rw-r--r-- | drivers/ata/libata-scsi.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 22643c0d9a56..47ea111d5ace 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -3347,20 +3347,23 @@ EXPORT_SYMBOL_GPL(ata_sas_slave_configure); | |||
3347 | * @ap: ATA port to which the command is being sent | 3347 | * @ap: ATA port to which the command is being sent |
3348 | * | 3348 | * |
3349 | * RETURNS: | 3349 | * RETURNS: |
3350 | * Zero. | 3350 | * Return value from __ata_scsi_queuecmd() if @cmd can be queued, |
3351 | * 0 otherwise. | ||
3351 | */ | 3352 | */ |
3352 | 3353 | ||
3353 | int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), | 3354 | int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *), |
3354 | struct ata_port *ap) | 3355 | struct ata_port *ap) |
3355 | { | 3356 | { |
3357 | int rc = 0; | ||
3358 | |||
3356 | ata_scsi_dump_cdb(ap, cmd); | 3359 | ata_scsi_dump_cdb(ap, cmd); |
3357 | 3360 | ||
3358 | if (likely(ata_scsi_dev_enabled(ap->device))) | 3361 | if (likely(ata_scsi_dev_enabled(ap->device))) |
3359 | __ata_scsi_queuecmd(cmd, done, ap->device); | 3362 | rc = __ata_scsi_queuecmd(cmd, done, ap->device); |
3360 | else { | 3363 | else { |
3361 | cmd->result = (DID_BAD_TARGET << 16); | 3364 | cmd->result = (DID_BAD_TARGET << 16); |
3362 | done(cmd); | 3365 | done(cmd); |
3363 | } | 3366 | } |
3364 | return 0; | 3367 | return rc; |
3365 | } | 3368 | } |
3366 | EXPORT_SYMBOL_GPL(ata_sas_queuecmd); | 3369 | EXPORT_SYMBOL_GPL(ata_sas_queuecmd); |