Skip to content

Commit 695cebe

Browse files
author
Christoph Hellwig
committed
dma-mapping: move more functions to dma-map-ops.h
Due to a mismerge a bunch of prototypes that should have moved to dma-map-ops.h are still in dma-mapping.h, fix that up. Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 0eb3b4a commit 695cebe

3 files changed

Lines changed: 24 additions & 25 deletions

File tree

include/linux/dma-map-ops.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,29 @@ static inline int dma_mmap_from_global_coherent(struct vm_area_struct *vma,
203203
}
204204
#endif /* CONFIG_DMA_DECLARE_COHERENT */
205205

206+
int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
207+
void *cpu_addr, dma_addr_t dma_addr, size_t size,
208+
unsigned long attrs);
209+
int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
210+
void *cpu_addr, dma_addr_t dma_addr, size_t size,
211+
unsigned long attrs);
212+
struct page *dma_common_alloc_pages(struct device *dev, size_t size,
213+
dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp);
214+
void dma_common_free_pages(struct device *dev, size_t size, struct page *vaddr,
215+
dma_addr_t dma_handle, enum dma_data_direction dir);
216+
217+
struct page **dma_common_find_pages(void *cpu_addr);
218+
void *dma_common_contiguous_remap(struct page *page, size_t size, pgprot_t prot,
219+
const void *caller);
220+
void *dma_common_pages_remap(struct page **pages, size_t size, pgprot_t prot,
221+
const void *caller);
222+
void dma_common_free_remap(void *cpu_addr, size_t size);
223+
224+
struct page *dma_alloc_from_pool(struct device *dev, size_t size,
225+
void **cpu_addr, gfp_t flags,
226+
bool (*phys_addr_ok)(struct device *, phys_addr_t, size_t));
227+
bool dma_free_from_pool(struct device *dev, void *start, size_t size);
228+
206229
#ifdef CONFIG_ARCH_HAS_DMA_COHERENCE_H
207230
#include <asm/dma-coherence.h>
208231
#elif defined(CONFIG_ARCH_HAS_SYNC_DMA_FOR_DEVICE) || \

include/linux/dma-mapping.h

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -389,30 +389,6 @@ static inline void dma_sync_sgtable_for_device(struct device *dev,
389389
#define dma_get_sgtable(d, t, v, h, s) dma_get_sgtable_attrs(d, t, v, h, s, 0)
390390
#define dma_mmap_coherent(d, v, c, h, s) dma_mmap_attrs(d, v, c, h, s, 0)
391391

392-
extern int dma_common_mmap(struct device *dev, struct vm_area_struct *vma,
393-
void *cpu_addr, dma_addr_t dma_addr, size_t size,
394-
unsigned long attrs);
395-
struct page *dma_common_alloc_pages(struct device *dev, size_t size,
396-
dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp);
397-
void dma_common_free_pages(struct device *dev, size_t size, struct page *vaddr,
398-
dma_addr_t dma_handle, enum dma_data_direction dir);
399-
struct page **dma_common_find_pages(void *cpu_addr);
400-
void *dma_common_contiguous_remap(struct page *page, size_t size,
401-
pgprot_t prot, const void *caller);
402-
403-
void *dma_common_pages_remap(struct page **pages, size_t size,
404-
pgprot_t prot, const void *caller);
405-
void dma_common_free_remap(void *cpu_addr, size_t size);
406-
407-
struct page *dma_alloc_from_pool(struct device *dev, size_t size,
408-
void **cpu_addr, gfp_t flags,
409-
bool (*phys_addr_ok)(struct device *, phys_addr_t, size_t));
410-
bool dma_free_from_pool(struct device *dev, void *start, size_t size);
411-
412-
int
413-
dma_common_get_sgtable(struct device *dev, struct sg_table *sgt, void *cpu_addr,
414-
dma_addr_t dma_addr, size_t size, unsigned long attrs);
415-
416392
static inline void *dma_alloc_coherent(struct device *dev, size_t size,
417393
dma_addr_t *dma_handle, gfp_t gfp)
418394
{

kernel/dma/remap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
* Copyright (c) 2014 The Linux Foundation
44
*/
5-
#include <linux/dma-mapping.h>
5+
#include <linux/dma-map-ops.h>
66
#include <linux/slab.h>
77
#include <linux/vmalloc.h>
88

0 commit comments

Comments
 (0)