scsi: qla2xxx: fully convert to the generic DMA API
The driver is currently using an odd mix of legacy PCI DMA API and generic DMA API calls, switch it over to the generic API entirely. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
60ea4fb138
commit
e7d0bb7746
|
@ -2425,7 +2425,7 @@ static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm)
|
|||
BUG_ON(cmd->sg_cnt == 0);
|
||||
|
||||
prm->sg = (struct scatterlist *)cmd->sg;
|
||||
prm->seg_cnt = pci_map_sg(cmd->qpair->pdev, cmd->sg,
|
||||
prm->seg_cnt = dma_map_sg(&cmd->qpair->pdev->dev, cmd->sg,
|
||||
cmd->sg_cnt, cmd->dma_data_direction);
|
||||
if (unlikely(prm->seg_cnt == 0))
|
||||
goto out_err;
|
||||
|
@ -2452,7 +2452,7 @@ static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm)
|
|||
|
||||
if (cmd->prot_sg_cnt) {
|
||||
prm->prot_sg = cmd->prot_sg;
|
||||
prm->prot_seg_cnt = pci_map_sg(cmd->qpair->pdev,
|
||||
prm->prot_seg_cnt = dma_map_sg(&cmd->qpair->pdev->dev,
|
||||
cmd->prot_sg, cmd->prot_sg_cnt,
|
||||
cmd->dma_data_direction);
|
||||
if (unlikely(prm->prot_seg_cnt == 0))
|
||||
|
@ -2487,12 +2487,12 @@ static void qlt_unmap_sg(struct scsi_qla_host *vha, struct qla_tgt_cmd *cmd)
|
|||
|
||||
qpair = cmd->qpair;
|
||||
|
||||
pci_unmap_sg(qpair->pdev, cmd->sg, cmd->sg_cnt,
|
||||
dma_unmap_sg(&qpair->pdev->dev, cmd->sg, cmd->sg_cnt,
|
||||
cmd->dma_data_direction);
|
||||
cmd->sg_mapped = 0;
|
||||
|
||||
if (cmd->prot_sg_cnt)
|
||||
pci_unmap_sg(qpair->pdev, cmd->prot_sg, cmd->prot_sg_cnt,
|
||||
dma_unmap_sg(&qpair->pdev->dev, cmd->prot_sg, cmd->prot_sg_cnt,
|
||||
cmd->dma_data_direction);
|
||||
|
||||
if (!cmd->ctx)
|
||||
|
|
|
@ -424,7 +424,7 @@ static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
|
|||
se_cmd->pi_err = 0;
|
||||
|
||||
/*
|
||||
* qla_target.c:qlt_rdy_to_xfer() will call pci_map_sg() to setup
|
||||
* qla_target.c:qlt_rdy_to_xfer() will call dma_map_sg() to setup
|
||||
* the SGL mappings into PCIe memory for incoming FCP WRITE data.
|
||||
*/
|
||||
return qlt_rdy_to_xfer(cmd);
|
||||
|
|
Loading…
Reference in New Issue