DMA-API: block: nvme-core: replace dma_set_mask()+dma_set_coherent_mask() with new helper
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
4886c399da
commit
052d0efada
|
@ -1949,12 +1949,9 @@ static int nvme_dev_map(struct nvme_dev *dev)
|
||||||
if (pci_request_selected_regions(pdev, bars, "nvme"))
|
if (pci_request_selected_regions(pdev, bars, "nvme"))
|
||||||
goto disable_pci;
|
goto disable_pci;
|
||||||
|
|
||||||
if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)))
|
if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) &&
|
||||||
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
|
dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)))
|
||||||
else if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)))
|
goto disable;
|
||||||
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
|
||||||
else
|
|
||||||
goto disable_pci;
|
|
||||||
|
|
||||||
pci_set_drvdata(pdev, dev);
|
pci_set_drvdata(pdev, dev);
|
||||||
dev->bar = ioremap(pci_resource_start(pdev, 0), 8192);
|
dev->bar = ioremap(pci_resource_start(pdev, 0), 8192);
|
||||||
|
@ -2168,6 +2165,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||||
|
|
||||||
INIT_LIST_HEAD(&dev->namespaces);
|
INIT_LIST_HEAD(&dev->namespaces);
|
||||||
dev->pci_dev = pdev;
|
dev->pci_dev = pdev;
|
||||||
|
|
||||||
result = nvme_set_instance(dev);
|
result = nvme_set_instance(dev);
|
||||||
if (result)
|
if (result)
|
||||||
goto free;
|
goto free;
|
||||||
|
|
Loading…
Reference in New Issue