hc
2024-02-19 1c055e55a242a33e574e48be530e06770a210dcd
kernel/arch/powerpc/include/asm/dma-direct.h
....@@ -2,28 +2,13 @@
22 #ifndef ASM_POWERPC_DMA_DIRECT_H
33 #define ASM_POWERPC_DMA_DIRECT_H 1
44
5
-static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size)
5
+static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
66 {
7
-#ifdef CONFIG_SWIOTLB
8
- struct dev_archdata *sd = &dev->archdata;
9
-
10
- if (sd->max_direct_dma_addr && addr + size > sd->max_direct_dma_addr)
11
- return false;
12
-#endif
13
-
14
- if (!dev->dma_mask)
15
- return false;
16
-
17
- return addr + size - 1 <= *dev->dma_mask;
7
+ return paddr + dev->archdata.dma_offset;
188 }
199
20
-static inline dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
10
+static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
2111 {
22
- return paddr + get_dma_offset(dev);
23
-}
24
-
25
-static inline phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t daddr)
26
-{
27
- return daddr - get_dma_offset(dev);
12
+ return daddr - dev->archdata.dma_offset;
2813 }
2914 #endif /* ASM_POWERPC_DMA_DIRECT_H */