diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-20 18:54:22 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-05-20 18:55:23 -0400 |
commit | 88a984ba0795f14a3847edbd7fabe652289ea89b (patch) | |
tree | cf82c612f595bf8296892ca5bfb0672d6d6f6f0f /include/linux/dma-mapping.h | |
parent | 77f2ea2f8d0833f9e976368481fb9a0775acf9e7 (diff) |
DMA-API: Change dma_declare_coherent_memory() CPU address to phys_addr_t
dma_declare_coherent_memory() takes two addresses for a region of memory: a
"bus_addr" and a "device_addr". I think the intent is that "bus_addr" is
the physical address a *CPU* would use to access the region, and
"device_addr" is the bus address the *device* would use to address the
region.
Rename "bus_addr" to "phys_addr" and change its type to phys_addr_t.
Most callers already supply a phys_addr_t for this argument. The others
supply a 32-bit integer (a constant, unsigned int, or __u32) and need no
change.
Use "unsigned long", not phys_addr_t, to hold PFNs.
No functional change (this could theoretically fix a truncation in a config
with 32-bit dma_addr_t and 64-bit phys_addr_t, but I don't think there are
any such cases involving this code).
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: James Bottomley <jbottomley@Parallels.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index b9aa2b97aab5..0c3eab1e39ac 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -192,7 +192,7 @@ static inline int dma_get_cache_alignment(void) | |||
192 | 192 | ||
193 | #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | 193 | #ifndef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY |
194 | static inline int | 194 | static inline int |
195 | dma_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | 195 | dma_declare_coherent_memory(struct device *dev, phys_addr_t phys_addr, |
196 | dma_addr_t device_addr, size_t size, int flags) | 196 | dma_addr_t device_addr, size_t size, int flags) |
197 | { | 197 | { |
198 | return 0; | 198 | return 0; |
@@ -223,13 +223,14 @@ extern void *dmam_alloc_noncoherent(struct device *dev, size_t size, | |||
223 | extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, | 223 | extern void dmam_free_noncoherent(struct device *dev, size_t size, void *vaddr, |
224 | dma_addr_t dma_handle); | 224 | dma_addr_t dma_handle); |
225 | #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY | 225 | #ifdef ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY |
226 | extern int dmam_declare_coherent_memory(struct device *dev, dma_addr_t bus_addr, | 226 | extern int dmam_declare_coherent_memory(struct device *dev, |
227 | phys_addr_t phys_addr, | ||
227 | dma_addr_t device_addr, size_t size, | 228 | dma_addr_t device_addr, size_t size, |
228 | int flags); | 229 | int flags); |
229 | extern void dmam_release_declared_memory(struct device *dev); | 230 | extern void dmam_release_declared_memory(struct device *dev); |
230 | #else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ | 231 | #else /* ARCH_HAS_DMA_DECLARE_COHERENT_MEMORY */ |
231 | static inline int dmam_declare_coherent_memory(struct device *dev, | 232 | static inline int dmam_declare_coherent_memory(struct device *dev, |
232 | dma_addr_t bus_addr, dma_addr_t device_addr, | 233 | phys_addr_t phys_addr, dma_addr_t device_addr, |
233 | size_t size, gfp_t gfp) | 234 | size_t size, gfp_t gfp) |
234 | { | 235 | { |
235 | return 0; | 236 | return 0; |