Christoph Hellwig | c5cd037 | 2017-12-23 10:56:51 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef _ASM_GENERIC_DMA_MAPPING_H |
| 3 | #define _ASM_GENERIC_DMA_MAPPING_H |
| 4 | |
| 5 | static inline const struct dma_map_ops *get_arch_dma_ops(struct bus_type *bus) |
| 6 | { |
Christoph Hellwig | 782e676 | 2018-04-16 15:24:51 +0200 | [diff] [blame] | 7 | /* |
| 8 | * Use the non-coherent ops if available. If an architecture wants a |
| 9 | * more fine-grained selection of operations it will have to implement |
| 10 | * get_arch_dma_ops itself or use the per-device dma_ops. |
| 11 | */ |
| 12 | #ifdef CONFIG_DMA_NONCOHERENT_OPS |
| 13 | return &dma_noncoherent_ops; |
| 14 | #else |
Christoph Hellwig | 002e674 | 2018-01-09 16:30:23 +0100 | [diff] [blame] | 15 | return &dma_direct_ops; |
Christoph Hellwig | 782e676 | 2018-04-16 15:24:51 +0200 | [diff] [blame] | 16 | #endif |
Christoph Hellwig | c5cd037 | 2017-12-23 10:56:51 +0100 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | #endif /* _ASM_GENERIC_DMA_MAPPING_H */ |