diff options
author | Christoph Hellwig <hch@lst.de> | 2018-10-11 09:56:58 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-17 21:58:53 -0400 |
commit | ec44a6762fc57c82acdf2c12ec9b542d9f308300 (patch) | |
tree | 436cf71aa2554d9eda243f4b7f0866314b6dc915 /drivers/scsi/qla4xxx | |
parent | e7d0bb774699be4542ec09e903a9cce38cea33d4 (diff) | |
download | linux-ec44a6762fc57c82acdf2c12ec9b542d9f308300.tar.bz2 |
scsi: qla4xxx: 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>
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 0e13349dce57..662c033f428d 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -3382,7 +3382,7 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode) if (task->data_count) { task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data, task->data_count, - PCI_DMA_TODEVICE); + DMA_TO_DEVICE); } DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n", @@ -3437,7 +3437,7 @@ static void qla4xxx_task_cleanup(struct iscsi_task *task) if (task->data_count) { dma_unmap_single(&ha->pdev->dev, task_data->data_dma, - task->data_count, PCI_DMA_TODEVICE); + task->data_count, DMA_TO_DEVICE); } DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n", @@ -9020,25 +9020,16 @@ static void qla4xxx_remove_adapter(struct pci_dev *pdev) /** * qla4xxx_config_dma_addressing() - Configure OS DMA addressing method. * @ha: HA context - * - * At exit, the @ha's flags.enable_64bit_addressing set to indicated - * supported addressing method. */ static void qla4xxx_config_dma_addressing(struct scsi_qla_host *ha) { - int retval; - /* Update our PCI device dma_mask for full 64 bit mask */ - if (pci_set_dma_mask(ha->pdev, DMA_BIT_MASK(64)) == 0) { - if (pci_set_consistent_dma_mask(ha->pdev, DMA_BIT_MASK(64))) { - dev_dbg(&ha->pdev->dev, - "Failed to set 64 bit PCI consistent mask; " - "using 32 bit.\n"); - retval = pci_set_consistent_dma_mask(ha->pdev, - DMA_BIT_MASK(32)); - } - } else - retval = pci_set_dma_mask(ha->pdev, DMA_BIT_MASK(32)); + if (dma_set_mask_and_coherent(&ha->pdev->dev, DMA_BIT_MASK(64))) { + dev_dbg(&ha->pdev->dev, + "Failed to set 64 bit PCI consistent mask; " + "using 32 bit.\n"); + dma_set_mask_and_coherent(&ha->pdev->dev, DMA_BIT_MASK(32)); + } } static int qla4xxx_slave_alloc(struct scsi_device *sdev) |