History

dma-mapping: improve selection of dma_declare_coherent availability

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.

Christoph Hellwig committed 7 years ago

Commit ff4c25f1 parent be4311a15 files · +13 −17Browse files

Showing the changes to include/linux (2 of 15 files). Show all

Unified · Split

2 files
  1. include/linux/device.h +1 −1
  2. include/linux/dma-mapping.h +4 −4
include/linux/device.h+1−1
@@ -1017,7 +1017,7 @@ struct device { · 1016 unmodified lines
10171017
10181018 struct list_head dma_pools; /* dma pools (if dma'ble) */
10191019
1020−#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
1020+#ifdef CONFIG_DMA_DECLARE_COHERENT
10211021 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
10221022 override */
10231023 #endif
include/linux/dma-mapping.h+4−4
@@ -153,7 +153,7 @@ static inline int is_device_dma_capable(struct device *dev) · 152 unmodified lines
153153 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
154154 }
155155
156−#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
156+#ifdef CONFIG_DMA_DECLARE_COHERENT
157157 /*
158158 * These three functions are only for dma allocator.
159159 * 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
192192 {
193193 return 0;
194194 }
195−#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
195+#endif /* CONFIG_DMA_DECLARE_COHERENT */
196196
197197 static inline bool dma_is_direct(const struct dma_map_ops *ops)
198198 {
@@ -739,7 +739,7 @@ static inline int dma_get_cache_alignment(void) · 540 unmodified lines
739739 /* flags for the coherent memory api */
740740 #define DMA_MEMORY_EXCLUSIVE 0x01
741741
742−#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
742+#ifdef CONFIG_DMA_DECLARE_COHERENT
743743 int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
744744 dma_addr_t device_addr, size_t size, int flags);
745745 void dma_release_declared_memory(struct device *dev);
@@ -764,7 +764,7 @@ dma_mark_declared_memory_occupied(struct device *dev, · 18 unmodified lines
764764 {
765765 return ERR_PTR(-EBUSY);
766766 }
767−#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */
767+#endif /* CONFIG_DMA_DECLARE_COHERENT */
768768
769769 static inline void *dmam_alloc_coherent(struct device *dev, size_t size,
770770 dma_addr_t *dma_handle, gfp_t gfp)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t