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
1017 1017
1018 struct list_head dma_pools; /* dma pools (if dma'ble) */1018 struct list_head dma_pools; /* dma pools (if dma'ble) */
1019 1019
1020#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT1020#ifdef CONFIG_DMA_DECLARE_COHERENT
1021 struct dma_coherent_mem *dma_mem; /* internal for coherent mem1021 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
1022 override */1022 override */
1023#endif1023#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
153 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;153 return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE;
154}154}
155 155
156#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT156#ifdef CONFIG_DMA_DECLARE_COHERENT
157/*157/*
158 * These three functions are only for dma allocator.158 * These three functions are only for dma allocator.
159 * Don't use them in device drivers.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 return 0;193 return 0;
194}194}
195#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */195#endif /* CONFIG_DMA_DECLARE_COHERENT */
196 196
197static inline bool dma_is_direct(const struct dma_map_ops *ops)197static 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/* flags for the coherent memory api */739/* flags for the coherent memory api */
740#define DMA_MEMORY_EXCLUSIVE 0x01740#define DMA_MEMORY_EXCLUSIVE 0x01
741 741
742#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT742#ifdef CONFIG_DMA_DECLARE_COHERENT
743int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,743int dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr,
744 dma_addr_t device_addr, size_t size, int flags);744 dma_addr_t device_addr, size_t size, int flags);
745void dma_release_declared_memory(struct device *dev);745void 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 return ERR_PTR(-EBUSY);765 return ERR_PTR(-EBUSY);
766}766}
767#endif /* CONFIG_HAVE_GENERIC_DMA_COHERENT */767#endif /* CONFIG_DMA_DECLARE_COHERENT */
768 768
769static inline void *dmam_alloc_coherent(struct device *dev, size_t size,769static inline void *dmam_alloc_coherent(struct device *dev, size_t size,
770 dma_addr_t *dma_handle, gfp_t gfp)770 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