Commit 1aa7d979 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Martin K. Petersen
Browse files

scsi: efct: Remove useless DMA-32 fallback configuration

As stated in [1], dma_set_mask() with a 64-bit mask never fails if
dev->dma_mask is non-NULL.  So, if it fails, the 32 bits case will also
fail for the same reason.

Simplify code and remove some dead code accordingly.

While at it, return the error code returned by dma_set_mask_and_coherent()
instead of -1.

[1]: https://lkml.org/lkml/2021/6/7/398

Link: https://lore.kernel.org/r/958bcb2a6e86344c14f38369e8e7079615a2b0e3.1641754613.git.christophe.jaillet@wanadoo.fr


Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 706dc3b9
Loading
Loading
Loading
Loading
+4 −7
Original line number Original line Diff line number Diff line
@@ -541,14 +541,11 @@ efct_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)


	pci_set_drvdata(pdev, efct);
	pci_set_drvdata(pdev, efct);


	if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) != 0) {
	rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
		dev_warn(&pdev->dev, "trying DMA_BIT_MASK(32)\n");
	if (rc) {
		if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)) != 0) {
		dev_err(&pdev->dev, "setting DMA_BIT_MASK failed\n");
		dev_err(&pdev->dev, "setting DMA_BIT_MASK failed\n");
			rc = -1;
		goto dma_mask_out;
		goto dma_mask_out;
	}
	}
	}


	num_interrupts = efct_device_interrupts_required(efct);
	num_interrupts = efct_device_interrupts_required(efct);
	if (num_interrupts < 0) {
	if (num_interrupts < 0) {