diff options
| author | Christoph Hellwig <hch@lst.de> | 2018-10-10 14:09:04 -0400 |
|---|---|---|
| committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-17 21:58:53 -0400 |
| commit | 60ea4fb138a66f8e08bc165225b89dfb942d0790 (patch) | |
| tree | 8ad1f9d4bac8a47d083cfa67e6f42d0f56472630 | |
| parent | 7ae7ce0bbefff16d24d932f650b9bd9e8c08c0da (diff) | |
scsi: qla1280: switch to generic DMA API
Switch from the legacy PCI DMA API to the generic DMA API.
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>
| -rw-r--r-- | drivers/scsi/qla1280.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 390775d5c918..15a50cc7e4b3 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c | |||
| @@ -1750,7 +1750,7 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha) | |||
| 1750 | uint8_t *sp, *tbuf; | 1750 | uint8_t *sp, *tbuf; |
| 1751 | dma_addr_t p_tbuf; | 1751 | dma_addr_t p_tbuf; |
| 1752 | 1752 | ||
| 1753 | tbuf = pci_alloc_consistent(ha->pdev, 8000, &p_tbuf); | 1753 | tbuf = dma_alloc_coherent(&ha->pdev->dev, 8000, &p_tbuf, GFP_KERNEL); |
| 1754 | if (!tbuf) | 1754 | if (!tbuf) |
| 1755 | return -ENOMEM; | 1755 | return -ENOMEM; |
| 1756 | #endif | 1756 | #endif |
| @@ -1841,7 +1841,7 @@ qla1280_load_firmware_dma(struct scsi_qla_host *ha) | |||
| 1841 | 1841 | ||
| 1842 | out: | 1842 | out: |
| 1843 | #if DUMP_IT_BACK | 1843 | #if DUMP_IT_BACK |
| 1844 | pci_free_consistent(ha->pdev, 8000, tbuf, p_tbuf); | 1844 | dma_free_coherent(&ha->pdev->dev, 8000, tbuf, p_tbuf); |
| 1845 | #endif | 1845 | #endif |
| 1846 | return err; | 1846 | return err; |
| 1847 | } | 1847 | } |
| @@ -4259,8 +4259,8 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 4259 | ha->devnum = devnum; /* specifies microcode load address */ | 4259 | ha->devnum = devnum; /* specifies microcode load address */ |
| 4260 | 4260 | ||
| 4261 | #ifdef QLA_64BIT_PTR | 4261 | #ifdef QLA_64BIT_PTR |
| 4262 | if (pci_set_dma_mask(ha->pdev, DMA_BIT_MASK(64))) { | 4262 | if (dma_set_mask(&ha->pdev->dev, DMA_BIT_MASK(64))) { |
| 4263 | if (pci_set_dma_mask(ha->pdev, DMA_BIT_MASK(32))) { | 4263 | if (dma_set_mask(&ha->pdev->dev, DMA_BIT_MASK(32))) { |
| 4264 | printk(KERN_WARNING "scsi(%li): Unable to set a " | 4264 | printk(KERN_WARNING "scsi(%li): Unable to set a " |
| 4265 | "suitable DMA mask - aborting\n", ha->host_no); | 4265 | "suitable DMA mask - aborting\n", ha->host_no); |
| 4266 | error = -ENODEV; | 4266 | error = -ENODEV; |
| @@ -4270,7 +4270,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 4270 | dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n", | 4270 | dprintk(2, "scsi(%li): 64 Bit PCI Addressing Enabled\n", |
| 4271 | ha->host_no); | 4271 | ha->host_no); |
| 4272 | #else | 4272 | #else |
| 4273 | if (pci_set_dma_mask(ha->pdev, DMA_BIT_MASK(32))) { | 4273 | if (dma_set_mask(&ha->pdev->dev, DMA_BIT_MASK(32))) { |
| 4274 | printk(KERN_WARNING "scsi(%li): Unable to set a " | 4274 | printk(KERN_WARNING "scsi(%li): Unable to set a " |
| 4275 | "suitable DMA mask - aborting\n", ha->host_no); | 4275 | "suitable DMA mask - aborting\n", ha->host_no); |
| 4276 | error = -ENODEV; | 4276 | error = -ENODEV; |
| @@ -4278,17 +4278,17 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 4278 | } | 4278 | } |
| 4279 | #endif | 4279 | #endif |
| 4280 | 4280 | ||
| 4281 | ha->request_ring = pci_alloc_consistent(ha->pdev, | 4281 | ha->request_ring = dma_alloc_coherent(&ha->pdev->dev, |
| 4282 | ((REQUEST_ENTRY_CNT + 1) * sizeof(request_t)), | 4282 | ((REQUEST_ENTRY_CNT + 1) * sizeof(request_t)), |
| 4283 | &ha->request_dma); | 4283 | &ha->request_dma, GFP_KERNEL); |
| 4284 | if (!ha->request_ring) { | 4284 | if (!ha->request_ring) { |
| 4285 | printk(KERN_INFO "qla1280: Failed to get request memory\n"); | 4285 | printk(KERN_INFO "qla1280: Failed to get request memory\n"); |
| 4286 | goto error_put_host; | 4286 | goto error_put_host; |
| 4287 | } | 4287 | } |
| 4288 | 4288 | ||
| 4289 | ha->response_ring = pci_alloc_consistent(ha->pdev, | 4289 | ha->response_ring = dma_alloc_coherent(&ha->pdev->dev, |
| 4290 | ((RESPONSE_ENTRY_CNT + 1) * sizeof(struct response)), | 4290 | ((RESPONSE_ENTRY_CNT + 1) * sizeof(struct response)), |
| 4291 | &ha->response_dma); | 4291 | &ha->response_dma, GFP_KERNEL); |
| 4292 | if (!ha->response_ring) { | 4292 | if (!ha->response_ring) { |
| 4293 | printk(KERN_INFO "qla1280: Failed to get response memory\n"); | 4293 | printk(KERN_INFO "qla1280: Failed to get response memory\n"); |
| 4294 | goto error_free_request_ring; | 4294 | goto error_free_request_ring; |
| @@ -4370,11 +4370,11 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 4370 | release_region(host->io_port, 0xff); | 4370 | release_region(host->io_port, 0xff); |
| 4371 | #endif | 4371 | #endif |
| 4372 | error_free_response_ring: | 4372 | error_free_response_ring: |
| 4373 | pci_free_consistent(ha->pdev, | 4373 | dma_free_coherent(&ha->pdev->dev, |
| 4374 | ((RESPONSE_ENTRY_CNT + 1) * sizeof(struct response)), | 4374 | ((RESPONSE_ENTRY_CNT + 1) * sizeof(struct response)), |
| 4375 | ha->response_ring, ha->response_dma); | 4375 | ha->response_ring, ha->response_dma); |
| 4376 | error_free_request_ring: | 4376 | error_free_request_ring: |
| 4377 | pci_free_consistent(ha->pdev, | 4377 | dma_free_coherent(&ha->pdev->dev, |
| 4378 | ((REQUEST_ENTRY_CNT + 1) * sizeof(request_t)), | 4378 | ((REQUEST_ENTRY_CNT + 1) * sizeof(request_t)), |
| 4379 | ha->request_ring, ha->request_dma); | 4379 | ha->request_ring, ha->request_dma); |
| 4380 | error_put_host: | 4380 | error_put_host: |
| @@ -4404,10 +4404,10 @@ qla1280_remove_one(struct pci_dev *pdev) | |||
| 4404 | release_region(host->io_port, 0xff); | 4404 | release_region(host->io_port, 0xff); |
| 4405 | #endif | 4405 | #endif |
| 4406 | 4406 | ||
| 4407 | pci_free_consistent(ha->pdev, | 4407 | dma_free_coherent(&ha->pdev->dev, |
| 4408 | ((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))), | 4408 | ((REQUEST_ENTRY_CNT + 1) * (sizeof(request_t))), |
| 4409 | ha->request_ring, ha->request_dma); | 4409 | ha->request_ring, ha->request_dma); |
| 4410 | pci_free_consistent(ha->pdev, | 4410 | dma_free_coherent(&ha->pdev->dev, |
| 4411 | ((RESPONSE_ENTRY_CNT + 1) * (sizeof(struct response))), | 4411 | ((RESPONSE_ENTRY_CNT + 1) * (sizeof(struct response))), |
| 4412 | ha->response_ring, ha->response_dma); | 4412 | ha->response_ring, ha->response_dma); |
| 4413 | 4413 | ||
