Skip to content

Commit e4db40e

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
scsi: hisi_sas: use dma_set_mask_and_coherent
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>
1 parent fdc32fb commit e4db40e

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2201,14 +2201,11 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id)
22012201
if (rc)
22022202
goto err_out_disable_device;
22032203

2204-
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0) ||
2205-
(pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64)) != 0)) {
2206-
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) ||
2207-
(pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)) {
2208-
dev_err(dev, "No usable DMA addressing method\n");
2209-
rc = -EIO;
2210-
goto err_out_regions;
2211-
}
2204+
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
2205+
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
2206+
dev_err(dev, "No usable DMA addressing method\n");
2207+
rc = -EIO;
2208+
goto err_out_regions;
22122209
}
22132210

22142211
shost = hisi_sas_shost_alloc_pci(pdev);

0 commit comments

Comments
 (0)