dma-mapping: consolidate dma_supported
[firefly-linux-kernel-4.4.55.git] / include / asm-generic / dma-mapping-common.h
index cdaa24193d4cff2939fb134e5a7094abbc8acb04..67fa6bcd644ce06062ab7bd425d96fc3208d73de 100644 (file)
@@ -327,4 +327,17 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 #endif
 }
 
+#ifndef HAVE_ARCH_DMA_SUPPORTED
+static inline int dma_supported(struct device *dev, u64 mask)
+{
+       struct dma_map_ops *ops = get_dma_ops(dev);
+
+       if (!ops)
+               return 0;
+       if (!ops->dma_supported)
+               return 1;
+       return ops->dma_supported(dev, mask);
+}
+#endif
+
 #endif