mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
scsi: ses: Convert to scsi_execute_cmd()
scsi_execute_req() is going to be removed. Convert ses to scsi_execute_cmd(). Signed-off-by: Mike Christie <michael.christie@oracle.com> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
6ff236e847
commit
ae4145a5f2
1 changed files with 10 additions and 4 deletions
|
@ -89,10 +89,13 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code,
|
||||||
unsigned char recv_page_code;
|
unsigned char recv_page_code;
|
||||||
unsigned int retries = SES_RETRIES;
|
unsigned int retries = SES_RETRIES;
|
||||||
struct scsi_sense_hdr sshdr;
|
struct scsi_sense_hdr sshdr;
|
||||||
|
const struct scsi_exec_args exec_args = {
|
||||||
|
.sshdr = &sshdr,
|
||||||
|
};
|
||||||
|
|
||||||
do {
|
do {
|
||||||
ret = scsi_execute_req(sdev, cmd, DMA_FROM_DEVICE, buf, bufflen,
|
ret = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_IN, buf, bufflen,
|
||||||
&sshdr, SES_TIMEOUT, 1, NULL);
|
SES_TIMEOUT, 1, &exec_args);
|
||||||
} while (ret > 0 && --retries && scsi_sense_valid(&sshdr) &&
|
} while (ret > 0 && --retries && scsi_sense_valid(&sshdr) &&
|
||||||
(sshdr.sense_key == NOT_READY ||
|
(sshdr.sense_key == NOT_READY ||
|
||||||
(sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29)));
|
(sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29)));
|
||||||
|
@ -130,10 +133,13 @@ static int ses_send_diag(struct scsi_device *sdev, int page_code,
|
||||||
};
|
};
|
||||||
struct scsi_sense_hdr sshdr;
|
struct scsi_sense_hdr sshdr;
|
||||||
unsigned int retries = SES_RETRIES;
|
unsigned int retries = SES_RETRIES;
|
||||||
|
const struct scsi_exec_args exec_args = {
|
||||||
|
.sshdr = &sshdr,
|
||||||
|
};
|
||||||
|
|
||||||
do {
|
do {
|
||||||
result = scsi_execute_req(sdev, cmd, DMA_TO_DEVICE, buf, bufflen,
|
result = scsi_execute_cmd(sdev, cmd, REQ_OP_DRV_OUT, buf,
|
||||||
&sshdr, SES_TIMEOUT, 1, NULL);
|
bufflen, SES_TIMEOUT, 1, &exec_args);
|
||||||
} while (result > 0 && --retries && scsi_sense_valid(&sshdr) &&
|
} while (result > 0 && --retries && scsi_sense_valid(&sshdr) &&
|
||||||
(sshdr.sense_key == NOT_READY ||
|
(sshdr.sense_key == NOT_READY ||
|
||||||
(sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29)));
|
(sshdr.sense_key == UNIT_ATTENTION && sshdr.asc == 0x29)));
|
||||||
|
|
Loading…
Reference in a new issue