Skip to content

Commit

Permalink
scsi: hisi_sas: use dma_set_mask_and_coherent
Browse files Browse the repository at this point in the history
The driver currently uses pci_set_dma_mask despite otherwise using the
generic DMA API.  Switch it over to the better generic DMA API.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
  • Loading branch information
Christoph Hellwig authored and Martin K. Petersen committed Nov 15, 2018
1 parent fdc32fb commit e4db40e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2201,14 +2201,11 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (rc)
goto err_out_disable_device;

if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) ||
(pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)) != 0)) {
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) ||
(pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)) {
dev_err(dev, "No usable DMA addressing method\n");
rc = -EIO;
goto err_out_regions;
}
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
dev_err(dev, "No usable DMA addressing method\n");
rc = -EIO;
goto err_out_regions;
}

shost = hisi_sas_shost_alloc_pci(pdev);
Expand Down

0 comments on commit e4db40e

Please sign in to comment.