]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/mips/loongson64/common/dma-swiotlb.c
Merge tag 'for-next-dma_ops' of git://git.kernel.org/pub/scm/linux/kernel/git/dledfor...
[karo-tx-linux.git] / arch / mips / loongson64 / common / dma-swiotlb.c
index 7296df043d9208fbf96e7ffe0c036ca2f1843dfd..178ca17a5667ee4d8584bfc585d69d3e88c7a6ba 100644 (file)
@@ -17,22 +17,14 @@ static void *loongson_dma_alloc_coherent(struct device *dev, size_t size,
        /* ignore region specifiers */
        gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
 
-#ifdef CONFIG_ISA
-       if (dev == NULL)
+       if ((IS_ENABLED(CONFIG_ISA) && dev == NULL) ||
+           (IS_ENABLED(CONFIG_ZONE_DMA) &&
+            dev->coherent_dma_mask < DMA_BIT_MASK(32)))
                gfp |= __GFP_DMA;
-       else
-#endif
-#ifdef CONFIG_ZONE_DMA
-       if (dev->coherent_dma_mask < DMA_BIT_MASK(32))
-               gfp |= __GFP_DMA;
-       else
-#endif
-#ifdef CONFIG_ZONE_DMA32
-       if (dev->coherent_dma_mask < DMA_BIT_MASK(40))
+       else if (IS_ENABLED(CONFIG_ZONE_DMA32) &&
+                dev->coherent_dma_mask < DMA_BIT_MASK(40))
                gfp |= __GFP_DMA32;
-       else
-#endif
-       ;
+
        gfp |= __GFP_NORETRY;
 
        ret = swiotlb_alloc_coherent(dev, size, dma_handle, gfp);