aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r--drivers/scsi/scsi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 2c0d0ec8150b..3b1ea34e1f5a 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -1070,8 +1070,8 @@ EXPORT_SYMBOL_GPL(scsi_get_vpd_page);
1070 * @opcode: opcode for command to look up 1070 * @opcode: opcode for command to look up
1071 * 1071 *
1072 * Uses the REPORT SUPPORTED OPERATION CODES to look up the given 1072 * Uses the REPORT SUPPORTED OPERATION CODES to look up the given
1073 * opcode. Returns 0 if RSOC fails or if the command opcode is 1073 * opcode. Returns -EINVAL if RSOC fails, 0 if the command opcode is
1074 * unsupported. Returns 1 if the device claims to support the command. 1074 * unsupported and 1 if the device claims to support the command.
1075 */ 1075 */
1076int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, 1076int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
1077 unsigned int len, unsigned char opcode) 1077 unsigned int len, unsigned char opcode)
@@ -1081,7 +1081,7 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
1081 int result; 1081 int result;
1082 1082
1083 if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) 1083 if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3)
1084 return 0; 1084 return -EINVAL;
1085 1085
1086 memset(cmd, 0, 16); 1086 memset(cmd, 0, 16);
1087 cmd[0] = MAINTENANCE_IN; 1087 cmd[0] = MAINTENANCE_IN;
@@ -1097,7 +1097,7 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer,
1097 if (result && scsi_sense_valid(&sshdr) && 1097 if (result && scsi_sense_valid(&sshdr) &&
1098 sshdr.sense_key == ILLEGAL_REQUEST && 1098 sshdr.sense_key == ILLEGAL_REQUEST &&
1099 (sshdr.asc == 0x20 || sshdr.asc == 0x24) && sshdr.ascq == 0x00) 1099 (sshdr.asc == 0x20 || sshdr.asc == 0x24) && sshdr.ascq == 0x00)
1100 return 0; 1100 return -EINVAL;
1101 1101
1102 if ((buffer[1] & 3) == 3) /* Command supported */ 1102 if ((buffer[1] & 3) == 3) /* Command supported */
1103 return 1; 1103 return 1;