This API is primarily used through DT entries, but two architectures and two drivers call it directly. So instead of selecting the config symbol for random architectures pull it in implicitly for the actual users. Also rename the Kconfig option to describe the feature better.
Showing the changes to include/linux (2 of 15 files). Show all
Unified · Split
| @@ -1017,7 +1017,7 @@ struct device { · 1016 unmodified lines | ||
| 1017 | 1017 | |
| 1018 | 1018 | struct list_head dma_pools; /* dma pools (if dma'ble) */ |
| 1019 | 1019 | |
| 1020 | −#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT | |
| 1020 | +#ifdef CONFIG_DMA_DECLARE_COHERENT | |
| 1021 | 1021 | struct dma_coherent_mem *dma_mem; /* internal for coherent mem |
| 1022 | 1022 | override */ |
| 1023 | 1023 | #endif |
| @@ -153,7 +153,7 @@ static inline int is_device_dma_capable(struct device *dev) · 152 unmodified lines | ||
| 153 | 153 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | −#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT | |
| 156 | +#ifdef CONFIG_DMA_DECLARE_COHERENT | |
| 157 | 157 | /* |
| 158 | 158 | * These three functions are only for dma allocator. |
| 159 | 159 | * Don't use them in device drivers. |
| @@ -192,7 +192,7 @@ static inline int dma_mmap_from_global_coherent(struct vm_area_struct *vma, · 32 unmodified lines | ||
| 192 | 192 | { |
| 193 | 193 | return 0; |
| 194 | 194 | } |
| 195 | −#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ | |
| 195 | +#endif /* CONFIG_DMA_DECLARE_COHERENT */ | |
| 196 | 196 | |
| 197 | 197 | static inline bool dma_is_direct(const struct dma_map_ops *ops) |
| 198 | 198 | { |
| @@ -739,7 +739,7 @@ static inline int dma_get_cache_alignment(void) · 540 unmodified lines | ||
| 739 | 739 | /* flags for the coherent memory api */ |
| 740 | 740 | #define DMA_MEMORY_EXCLUSIVE 0x01 |
| 741 | 741 | |
| 742 | −#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT | |
| 742 | +#ifdef CONFIG_DMA_DECLARE_COHERENT | |
| 743 | 743 | int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, |
| 744 | 744 | dma_addr_t device_addr, size_t size, int flags); |
| 745 | 745 | void dma_release_declared_memory(struct device *dev); |
| @@ -764,7 +764,7 @@ dma_mark_declared_memory_occupied(struct device *dev, · 18 unmodified lines | ||
| 764 | 764 | { |
| 765 | 765 | return ERR_PTR(-EBUSY); |
| 766 | 766 | } |
| 767 | −#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */ | |
| 767 | +#endif /* CONFIG_DMA_DECLARE_COHERENT */ | |
| 768 | 768 | |
| 769 | 769 | static inline void *dmam_alloc_coherent(struct device *dev, size_t size, |
| 770 | 770 | dma_addr_t *dma_handle, gfp_t gfp) |