scsi: isci: use dma_set_mask_and_coherent
authorChristoph Hellwig <hch@lst.de>
Thu, 18 Oct 2018 13:10:20 +0000 (15:10 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 15 Nov 2018 19:27:08 +0000 (14:27 -0500)
The driver currently uses pci_set_dma_mask despite otherwise using the
generic DMA API.  Switch it over to the better generic DMA API.

[mkp: s/iscsi/isci/]

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/isci/init.c

index 08c7b1e25fe481503ae5d4fd48324f703b40addf..d72edbcbb7c67d727fa6ddfdbdef6493683b2c96 100644 (file)
@@ -304,21 +304,10 @@ static int isci_pci_init(struct pci_dev *pdev)
 
        pci_set_master(pdev);
 
-       err = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
-       if (err) {
-               err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
-               if (err)
-                       return err;
-       }
-
-       err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
-       if (err) {
-               err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
-               if (err)
-                       return err;
-       }
-
-       return 0;
+       err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
+       if (err)
+               err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
+       return err;
 }
 
 static int num_controllers(struct pci_dev *pdev)