From: Christoph Hellwig Date: Thu, 18 Oct 2018 13:10:17 +0000 (+0200) Subject: scsi: hisi_sas: use dma_set_mask_and_coherent X-Git-Tag: archive/raspbian/5.2.17-1+rpi1^2^2^2~29 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=06b96218e154b1a8f540e8121c718d909db48cd1;p=linux.git 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 Acked-by: John Garry Signed-off-by: Martin K. Petersen Gbp-Pq: Topic bugfix/arm64/huawei-taishan Gbp-Pq: Name 0009-scsi-hisi_sas-use-dma_set_mask_and_coherent.patch --- diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index c3e0be90e19..43005d39abe 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -2199,14 +2199,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);