@@ -117,14 +117,6 @@ dma_addr_t dma_map_resource(struct device *dev, phys_addr_t phys_addr,
117117 size_t size , enum dma_data_direction dir , unsigned long attrs );
118118void dma_unmap_resource (struct device * dev , dma_addr_t addr , size_t size ,
119119 enum dma_data_direction dir , unsigned long attrs );
120- void dma_sync_single_for_cpu (struct device * dev , dma_addr_t addr , size_t size ,
121- enum dma_data_direction dir );
122- void dma_sync_single_for_device (struct device * dev , dma_addr_t addr ,
123- size_t size , enum dma_data_direction dir );
124- void dma_sync_sg_for_cpu (struct device * dev , struct scatterlist * sg ,
125- int nelems , enum dma_data_direction dir );
126- void dma_sync_sg_for_device (struct device * dev , struct scatterlist * sg ,
127- int nelems , enum dma_data_direction dir );
128120void * dma_alloc_attrs (struct device * dev , size_t size , dma_addr_t * dma_handle ,
129121 gfp_t flag , unsigned long attrs );
130122void dma_free_attrs (struct device * dev , size_t size , void * cpu_addr ,
@@ -147,7 +139,6 @@ u64 dma_get_required_mask(struct device *dev);
147139bool dma_addressing_limited (struct device * dev );
148140size_t dma_max_mapping_size (struct device * dev );
149141size_t dma_opt_mapping_size (struct device * dev );
150- bool dma_need_sync (struct device * dev , dma_addr_t dma_addr );
151142unsigned long dma_get_merge_boundary (struct device * dev );
152143struct sg_table * dma_alloc_noncontiguous (struct device * dev , size_t size ,
153144 enum dma_data_direction dir , gfp_t gfp , unsigned long attrs );
@@ -195,22 +186,6 @@ static inline void dma_unmap_resource(struct device *dev, dma_addr_t addr,
195186 size_t size , enum dma_data_direction dir , unsigned long attrs )
196187{
197188}
198- static inline void dma_sync_single_for_cpu (struct device * dev , dma_addr_t addr ,
199- size_t size , enum dma_data_direction dir )
200- {
201- }
202- static inline void dma_sync_single_for_device (struct device * dev ,
203- dma_addr_t addr , size_t size , enum dma_data_direction dir )
204- {
205- }
206- static inline void dma_sync_sg_for_cpu (struct device * dev ,
207- struct scatterlist * sg , int nelems , enum dma_data_direction dir )
208- {
209- }
210- static inline void dma_sync_sg_for_device (struct device * dev ,
211- struct scatterlist * sg , int nelems , enum dma_data_direction dir )
212- {
213- }
214189static inline int dma_mapping_error (struct device * dev , dma_addr_t dma_addr )
215190{
216191 return - ENOMEM ;
@@ -277,10 +252,6 @@ static inline size_t dma_opt_mapping_size(struct device *dev)
277252{
278253 return 0 ;
279254}
280- static inline bool dma_need_sync (struct device * dev , dma_addr_t dma_addr )
281- {
282- return false;
283- }
284255static inline unsigned long dma_get_merge_boundary (struct device * dev )
285256{
286257 return 0 ;
@@ -310,6 +281,39 @@ static inline int dma_mmap_noncontiguous(struct device *dev,
310281}
311282#endif /* CONFIG_HAS_DMA */
312283
284+ #if defined(CONFIG_HAS_DMA ) && defined(CONFIG_DMA_NEED_SYNC )
285+ void dma_sync_single_for_cpu (struct device * dev , dma_addr_t addr , size_t size ,
286+ enum dma_data_direction dir );
287+ void dma_sync_single_for_device (struct device * dev , dma_addr_t addr ,
288+ size_t size , enum dma_data_direction dir );
289+ void dma_sync_sg_for_cpu (struct device * dev , struct scatterlist * sg ,
290+ int nelems , enum dma_data_direction dir );
291+ void dma_sync_sg_for_device (struct device * dev , struct scatterlist * sg ,
292+ int nelems , enum dma_data_direction dir );
293+ bool dma_need_sync (struct device * dev , dma_addr_t dma_addr );
294+ #else /* !CONFIG_HAS_DMA || !CONFIG_DMA_NEED_SYNC */
295+ static inline void dma_sync_single_for_cpu (struct device * dev , dma_addr_t addr ,
296+ size_t size , enum dma_data_direction dir )
297+ {
298+ }
299+ static inline void dma_sync_single_for_device (struct device * dev ,
300+ dma_addr_t addr , size_t size , enum dma_data_direction dir )
301+ {
302+ }
303+ static inline void dma_sync_sg_for_cpu (struct device * dev ,
304+ struct scatterlist * sg , int nelems , enum dma_data_direction dir )
305+ {
306+ }
307+ static inline void dma_sync_sg_for_device (struct device * dev ,
308+ struct scatterlist * sg , int nelems , enum dma_data_direction dir )
309+ {
310+ }
311+ static inline bool dma_need_sync (struct device * dev , dma_addr_t dma_addr )
312+ {
313+ return false;
314+ }
315+ #endif /* !CONFIG_HAS_DMA || !CONFIG_DMA_NEED_SYNC */
316+
313317struct page * dma_alloc_pages (struct device * dev , size_t size ,
314318 dma_addr_t * dma_handle , enum dma_data_direction dir , gfp_t gfp );
315319void dma_free_pages (struct device * dev , size_t size , struct page * page ,
0 commit comments