Commit e7d0bb77 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Martin K. Petersen
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 60ea4fb1
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -2425,7 +2425,7 @@ static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm)
	BUG_ON(cmd->sg_cnt == 0);
	BUG_ON(cmd->sg_cnt == 0);


	prm->sg = (struct scatterlist *)cmd->sg;
	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);
	    cmd->sg_cnt, cmd->dma_data_direction);
	if (unlikely(prm->seg_cnt == 0))
	if (unlikely(prm->seg_cnt == 0))
		goto out_err;
		goto out_err;
@@ -2452,7 +2452,7 @@ static int qlt_pci_map_calc_cnt(struct qla_tgt_prm *prm)


		if (cmd->prot_sg_cnt) {
		if (cmd->prot_sg_cnt) {
			prm->prot_sg      = cmd->prot_sg;
			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->prot_sg, cmd->prot_sg_cnt,
				cmd->dma_data_direction);
				cmd->dma_data_direction);
			if (unlikely(prm->prot_seg_cnt == 0))
			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;
	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->dma_data_direction);
	cmd->sg_mapped = 0;
	cmd->sg_mapped = 0;


	if (cmd->prot_sg_cnt)
	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);
			cmd->dma_data_direction);


	if (!cmd->ctx)
	if (!cmd->ctx)
+1 −1
Original line number Original line Diff line number Diff line
@@ -424,7 +424,7 @@ static int tcm_qla2xxx_write_pending(struct se_cmd *se_cmd)
	se_cmd->pi_err = 0;
	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.
	 * the SGL mappings into PCIe memory for incoming FCP WRITE data.
	 */
	 */
	return qlt_rdy_to_xfer(cmd);
	return qlt_rdy_to_xfer(cmd);