diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-06-26 21:39:06 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-06-26 21:39:06 -0700 |
| commit | 18e7648d41e6cfb1c19aa4b5dfc200aac6031c09 (patch) | |
| tree | 6d31df58205413f1c2c93c015ca993aa038c32f1 | |
| parent | b0b763bf53af4453c1b3906986e0336f4064ec0a (diff) | |
| parent | b9e9d371417dd30387ee1296c2e83c40df137080 (diff) | |
Merge "iommu: Fix compilation errors without CONFIG_IOMMU_API" into dev/msm-4.4-8996au
| -rw-r--r-- | arch/arm64/mm/dma-mapping.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index b9e9fad4a2db..aa0c5a414912 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c @@ -3,6 +3,7 @@ * * Copyright (C) 2012 ARM Ltd. * Author: Catalin Marinas <catalin.marinas@arm.com> + * Copyright (c) 2017, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -49,17 +50,6 @@ static pgprot_t __get_dma_pgprot(struct dma_attrs *attrs, pgprot_t prot, return prot; } -static int __get_iommu_pgprot(struct dma_attrs *attrs, int prot, - bool coherent) -{ - if (!dma_get_attr(DMA_ATTR_EXEC_MAPPING, attrs)) - prot |= IOMMU_NOEXEC; - if (coherent) - prot |= IOMMU_CACHE; - - return prot; -} - static bool is_dma_coherent(struct device *dev, struct dma_attrs *attrs) { bool is_coherent; @@ -1143,6 +1133,17 @@ EXPORT_SYMBOL(arch_setup_dma_ops); #ifdef CONFIG_ARM64_DMA_USE_IOMMU +static int __get_iommu_pgprot(struct dma_attrs *attrs, int prot, + bool coherent) +{ + if (!dma_get_attr(DMA_ATTR_EXEC_MAPPING, attrs)) + prot |= IOMMU_NOEXEC; + if (coherent) + prot |= IOMMU_CACHE; + + return prot; +} + /* * Make an area consistent for devices. * Note: Drivers should NOT use this function directly, as it will break |
