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>
* @ap: ATA port to which the command is being sent
*
* RETURNS:
* @ap: ATA port to which the command is being sent
*
* RETURNS:
+ * Return value from __ata_scsi_queuecmd() if @cmd can be queued,
+ * 0 otherwise.
*/
int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
struct ata_port *ap)
{
*/
int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
struct ata_port *ap)
{
ata_scsi_dump_cdb(ap, cmd);
if (likely(ata_scsi_dev_enabled(ap->device)))
ata_scsi_dump_cdb(ap, cmd);
if (likely(ata_scsi_dev_enabled(ap->device)))
- __ata_scsi_queuecmd(cmd, done, ap->device);
+ rc = __ata_scsi_queuecmd(cmd, done, ap->device);
else {
cmd->result = (DID_BAD_TARGET << 16);
done(cmd);
}
else {
cmd->result = (DID_BAD_TARGET << 16);
done(cmd);
}
}
EXPORT_SYMBOL_GPL(ata_sas_queuecmd);
}
EXPORT_SYMBOL_GPL(ata_sas_queuecmd);