Commit 2e4b231a authored by Bart Van Assche's avatar Bart Van Assche Committed by Martin K. Petersen

scsi: NCR5380: Use sc_data_direction instead of rq_data_dir()

This patch prepares for the removal of the request pointer from struct
scsi_cmnd and does not change any functionality.

Link: https://lore.kernel.org/r/20210809230355.8186-13-bvanassche@acm.org
Cc: Michael Schmitz <schmitzmic@gmail.com>
Suggested-by: default avatarFinn Thain <fthain@linux-m68k.org>
Acked-by: default avatarFinn Thain <fthain@linux-m68k.org>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent cd4b46cd
......@@ -778,7 +778,7 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance)
}
#ifdef CONFIG_SUN3
if ((sun3scsi_dma_finish(rq_data_dir(hostdata->connected->request)))) {
if (sun3scsi_dma_finish(hostdata->connected->sc_data_direction)) {
pr_err("scsi%d: overrun in UDC counter -- not prepared to deal with this!\n",
instance->host_no);
BUG();
......@@ -1710,7 +1710,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
count = sun3scsi_dma_xfer_len(hostdata, cmd);
if (count > 0) {
if (rq_data_dir(cmd->request))
if (cmd->sc_data_direction == DMA_TO_DEVICE)
sun3scsi_dma_send_setup(hostdata,
cmd->SCp.ptr, count);
else
......@@ -2158,7 +2158,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
count = sun3scsi_dma_xfer_len(hostdata, tmp);
if (count > 0) {
if (rq_data_dir(tmp->request))
if (tmp->sc_data_direction == DMA_TO_DEVICE)
sun3scsi_dma_send_setup(hostdata,
tmp->SCp.ptr, count);
else
......
......@@ -366,8 +366,9 @@ static inline int sun3scsi_dma_start(unsigned long count, unsigned char *data)
}
/* clean up after our dma is done */
static int sun3scsi_dma_finish(int write_flag)
static int sun3scsi_dma_finish(enum dma_data_direction data_dir)
{
const bool write_flag = data_dir == DMA_TO_DEVICE;
unsigned short __maybe_unused count;
unsigned short fifo;
int ret = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment