]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - lib/iommu-common.c
Merge remote-tracking branch 'remotes/stable/linux-4.4.y' into karo-tx6-mainline
[karo-tx-linux.git] / lib / iommu-common.c
index b1c93e94ca7a430ea68c717e0e26d56057d75636..858dc1aae478bad9cb30275cb7fd7905d73f6ede 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/hash.h>
 
-#ifndef        DMA_ERROR_CODE
-#define        DMA_ERROR_CODE (~(dma_addr_t)0x0)
-#endif
-
 static unsigned long iommu_large_alloc = 15;
 
 static DEFINE_PER_CPU(unsigned int, iommu_hash_common);
@@ -123,7 +119,7 @@ unsigned long iommu_tbl_range_alloc(struct device *dev,
        /* Sanity check */
        if (unlikely(npages == 0)) {
                WARN_ON_ONCE(1);
-               return DMA_ERROR_CODE;
+               return IOMMU_ERROR_CODE;
        }
 
        if (largealloc) {
@@ -206,7 +202,7 @@ unsigned long iommu_tbl_range_alloc(struct device *dev,
                        goto again;
                } else {
                        /* give up */
-                       n = DMA_ERROR_CODE;
+                       n = IOMMU_ERROR_CODE;
                        goto bail;
                }
        }
@@ -259,7 +255,7 @@ void iommu_tbl_range_free(struct iommu_map_table *iommu, u64 dma_addr,
        unsigned long flags;
        unsigned long shift = iommu->table_shift;
 
-       if (entry == DMA_ERROR_CODE) /* use default addr->entry mapping */
+       if (entry == IOMMU_ERROR_CODE) /* use default addr->entry mapping */
                entry = (dma_addr - iommu->table_map_base) >> shift;
        pool = get_pool(iommu, entry);