Commit 3b9c6c11 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by Linus Torvalds
Browse files

dma-mapping: remove dma_is_consistent API



Architectures implement dma_is_consistent() in different ways (some
misinterpret the definition of API in DMA-API.txt).  So it hasn't been so
useful for drivers.  We have only one user of the API in tree.  Unlikely
out-of-tree drivers use the API.

Even if we fix dma_is_consistent() in some architectures, it doesn't look
useful at all.  It was invented long ago for some old systems that can't
allocate coherent memory at all.  It's better to export only APIs that are
definitely necessary for drivers.

Let's remove this API.

Signed-off-by: default avatarFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d80e0d96
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -455,12 +455,6 @@ Free memory allocated by the nonconsistent API. All parameters must
be identical to those passed in (and returned by
dma_alloc_noncoherent()).

int
dma_is_consistent(struct device *dev, dma_addr_t dma_handle)

Returns true if the device dev is performing consistent DMA on the memory
area pointed to by the dma_handle.

int
dma_get_cache_alignment(void)

+0 −1
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@ static inline int dma_set_mask(struct device *dev, u64 mask)

#define dma_alloc_noncoherent(d, s, h, f)	dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h)	dma_free_coherent(d, s, v, h)
#define dma_is_consistent(d, h)			(1)

#define dma_cache_sync(dev, va, size, dir)		  ((void)0)

+0 −5
Original line number Diff line number Diff line
@@ -144,11 +144,6 @@ static inline int dma_set_mask(struct device *dev, u64 dma_mask)
	return 0;
}

static inline int dma_is_consistent(struct device *dev, dma_addr_t handle)
{
	return !!arch_is_coherent();
}

/*
 * DMA errors are defined by all-bits-set in the DMA address.
 */
+0 −5
Original line number Diff line number Diff line
@@ -336,9 +336,4 @@ dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)

static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
{
	return 1;
}

#endif /* __ASM_AVR32_DMA_MAPPING_H */
+0 −1
Original line number Diff line number Diff line
@@ -21,7 +21,6 @@ void dma_free_coherent(struct device *dev, size_t size, void *vaddr,
#define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f)
#define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h)
#define dma_supported(d, m)         (1)
#define dma_is_consistent(d, h)     (1)

static inline int
dma_set_mask(struct device *dev, u64 dma_mask)
Loading