]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm64/include/asm/dma-mapping.h
arm64: Combine coherent and non-coherent swiotlb dma_ops
[karo-tx-linux.git] / arch / arm64 / include / asm / dma-mapping.h
index 9ce3e680ae1c6f2b78dab11bf5d89384f5366f23..6932bb57dba0210cd2605dc4081571f84150b615 100644 (file)
@@ -28,8 +28,6 @@
 
 #define DMA_ERROR_CODE (~(dma_addr_t)0)
 extern struct dma_map_ops *dma_ops;
-extern struct dma_map_ops coherent_swiotlb_dma_ops;
-extern struct dma_map_ops noncoherent_swiotlb_dma_ops;
 
 static inline struct dma_map_ops *__generic_dma_ops(struct device *dev)
 {
@@ -47,23 +45,18 @@ static inline struct dma_map_ops *get_dma_ops(struct device *dev)
                return __generic_dma_ops(dev);
 }
 
-static inline void set_dma_ops(struct device *dev, struct dma_map_ops *ops)
-{
-       dev->archdata.dma_ops = ops;
-}
-
 static inline void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size,
                                      struct iommu_ops *iommu, bool coherent)
 {
        dev->archdata.dma_coherent = coherent;
-       if (coherent)
-               set_dma_ops(dev, &coherent_swiotlb_dma_ops);
 }
 #define arch_setup_dma_ops     arch_setup_dma_ops
 
 /* do not use this function in a driver */
 static inline bool is_device_dma_coherent(struct device *dev)
 {
+       if (!dev)
+               return false;
        return dev->archdata.dma_coherent;
 }