From 7dfe0b5e7ca67c659475883712c1d0449f900f9c Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Thu, 29 Dec 2022 13:01:45 -0600 Subject: scsi: core: Convert to scsi_execute_cmd() scsi_execute_req() is going to be removed. Convert SCSI midlayer to scsi_execute_cmd(). Signed-off-by: Mike Christie Reviewed-by: John Garry Reviewed-by: Bart Van Assche Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen --- drivers/scsi/scsi.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/scsi/scsi.c') diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 1426b9b03612..00ee47a04403 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -309,8 +309,8 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, * I'm not convinced we need to try quite this hard to get VPD, but * all the existing users tried this hard. */ - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - len, NULL, 30 * HZ, 3, NULL); + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, len, + 30 * HZ, 3, NULL); if (result) return -EIO; @@ -510,6 +510,9 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, unsigned char cmd[16]; struct scsi_sense_hdr sshdr; int result, request_len; + const struct scsi_exec_args exec_args = { + .sshdr = &sshdr, + }; if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) return -EINVAL; @@ -531,9 +534,8 @@ int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, put_unaligned_be32(request_len, &cmd[6]); memset(buffer, 0, len); - result = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buffer, - request_len, &sshdr, 30 * HZ, 3, NULL); - + result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buffer, + request_len, 30 * HZ, 3, &exec_args); if (result < 0) return result; if (result && scsi_sense_valid(&sshdr) && -- cgit v1.2.3