diff options
author | Christoph Hellwig <hch@lst.de> | 2018-10-10 19:09:42 +0300 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-10-18 04:58:51 +0300 |
commit | 4d431b182e67da090f6bbe092281f49cab1a55f2 (patch) | |
tree | 709de15a821c5e50200d994af0dd071aad8ff9d7 /drivers/scsi/a100u2w.c | |
parent | 17a361b20a0f908ca3952778b063994435164fe8 (diff) | |
download | linux-4d431b182e67da090f6bbe092281f49cab1a55f2.tar.xz |
scsi: a100u2w: 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>
Diffstat (limited to 'drivers/scsi/a100u2w.c')
-rw-r--r-- | drivers/scsi/a100u2w.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index 23b17621b6d2..00072ed9540b 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -1094,7 +1094,7 @@ static int inia100_probe_one(struct pci_dev *pdev, if (pci_enable_device(pdev)) goto out; - if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) { + if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32))) { printk(KERN_WARNING "Unable to set 32bit DMA " "on inia100 adapter, ignoring.\n"); goto out_disable_device; @@ -1124,7 +1124,8 @@ static int inia100_probe_one(struct pci_dev *pdev, /* Get total memory needed for SCB */ sz = ORC_MAXQUEUE * sizeof(struct orc_scb); - host->scb_virt = pci_zalloc_consistent(pdev, sz, &host->scb_phys); + host->scb_virt = dma_zalloc_coherent(&pdev->dev, sz, &host->scb_phys, + GFP_KERNEL); if (!host->scb_virt) { printk("inia100: SCB memory allocation error\n"); goto out_host_put; @@ -1132,7 +1133,8 @@ static int inia100_probe_one(struct pci_dev *pdev, /* Get total memory needed for ESCB */ sz = ORC_MAXQUEUE * sizeof(struct orc_extended_scb); - host->escb_virt = pci_zalloc_consistent(pdev, sz, &host->escb_phys); + host->escb_virt = dma_zalloc_coherent(&pdev->dev, sz, &host->escb_phys, + GFP_KERNEL); if (!host->escb_virt) { printk("inia100: ESCB memory allocation error\n"); goto out_free_scb_array; @@ -1177,10 +1179,12 @@ static int inia100_probe_one(struct pci_dev *pdev, out_free_irq: free_irq(shost->irq, shost); out_free_escb_array: - pci_free_consistent(pdev, ORC_MAXQUEUE * sizeof(struct orc_extended_scb), + dma_free_coherent(&pdev->dev, + ORC_MAXQUEUE * sizeof(struct orc_extended_scb), host->escb_virt, host->escb_phys); out_free_scb_array: - pci_free_consistent(pdev, ORC_MAXQUEUE * sizeof(struct orc_scb), + dma_free_coherent(&pdev->dev, + ORC_MAXQUEUE * sizeof(struct orc_scb), host->scb_virt, host->scb_phys); out_host_put: scsi_host_put(shost); @@ -1200,9 +1204,11 @@ static void inia100_remove_one(struct pci_dev *pdev) scsi_remove_host(shost); free_irq(shost->irq, shost); - pci_free_consistent(pdev, ORC_MAXQUEUE * sizeof(struct orc_extended_scb), + dma_free_coherent(&pdev->dev, + ORC_MAXQUEUE * sizeof(struct orc_extended_scb), host->escb_virt, host->escb_phys); - pci_free_consistent(pdev, ORC_MAXQUEUE * sizeof(struct orc_scb), + dma_free_coherent(&pdev->dev, + ORC_MAXQUEUE * sizeof(struct orc_scb), host->scb_virt, host->scb_phys); release_region(shost->io_port, 256); |