diff options
author | Christoph Hellwig <hch@lst.de> | 2019-02-15 09:06:31 +0100 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-02-20 15:28:53 +0100 |
commit | c54fc984dae5fb0007ddfc46dabde6631735689d (patch) | |
tree | 405f8c2a91ab37bbb46d8255ca8378870eac4bdb /arch/sparc/kernel/iommu.c | |
parent | ccio: allow large DMA masks (diff) | |
download | linux-c54fc984dae5fb0007ddfc46dabde6631735689d.tar.xz linux-c54fc984dae5fb0007ddfc46dabde6631735689d.zip |
sparc64: refactor the ali DMA quirk
Do the quirk first in the dma_supported routines, as we don't need
any of the other checks for it, and remove the duplicate mask checking
that is already done by the callers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/iommu.c')
-rw-r--r-- | arch/sparc/kernel/iommu.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index b1a09080e8da..0c253f1c852e 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c @@ -745,14 +745,13 @@ static int dma_4u_supported(struct device *dev, u64 device_mask) { struct iommu *iommu = dev->archdata.iommu; + if (ali_sound_dma_hack(dev, device_mask)) + return 1; + if (device_mask > DMA_BIT_MASK(32)) return 0; if ((device_mask & iommu->dma_addr_mask) == iommu->dma_addr_mask) return 1; -#ifdef CONFIG_PCI - if (dev_is_pci(dev)) - return pci64_dma_supported(to_pci_dev(dev), device_mask); -#endif return 0; } |