]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
dma-mapping: remove dma_is_consistent API
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Wed, 11 Aug 2010 01:03:25 +0000 (18:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Aug 2010 15:59:21 +0000 (08:59 -0700)
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: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22 files changed:
Documentation/DMA-API.txt
arch/alpha/include/asm/dma-mapping.h
arch/arm/include/asm/dma-mapping.h
arch/avr32/include/asm/dma-mapping.h
arch/blackfin/include/asm/dma-mapping.h
arch/cris/include/asm/dma-mapping.h
arch/frv/include/asm/dma-mapping.h
arch/ia64/include/asm/dma-mapping.h
arch/m68k/include/asm/dma-mapping.h
arch/microblaze/include/asm/dma-mapping.h
arch/mips/include/asm/dma-mapping.h
arch/mips/mm/dma-default.c
arch/mn10300/include/asm/dma-mapping.h
arch/parisc/include/asm/dma-mapping.h
arch/powerpc/include/asm/dma-mapping.h
arch/sh/include/asm/dma-mapping.h
arch/sparc/include/asm/dma-mapping.h
arch/tile/include/asm/dma-mapping.h
arch/um/include/asm/dma-mapping.h
arch/x86/include/asm/dma-mapping.h
arch/xtensa/include/asm/dma-mapping.h
include/asm-generic/dma-mapping-broken.h

index 05e2ae236865edf6b56e2357c6089432793be077..fe2326906610d15c25b928000d343b7917046bce 100644 (file)
@@ -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)
 
index b3423d96acc77696791fd9964442cf96bf5eb90f..4567aca6fdd6ef32e3730c60fa725b98f299d8aa 100644 (file)
@@ -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)
 
index f4a996d5ae96ddbc7f1040d5d0a4aaebe8c22c71..c568da7dcae45e60e8630e2b3060599f561d6555 100644 (file)
@@ -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.
  */
index af6b8165507403065acfc98887a90b98459eac54..aaf5199d8fcbfb69ddca12e7d48fd816f791e341 100644 (file)
@@ -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 */
index 6694a0f55de92d9d5011221e573339c193b9ba46..bbf461076a0a2107ddc6ea932bc615fe74fdc7a1 100644 (file)
@@ -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)
index fc30fd0b2a04c53eb1842be6358f3921858110b0..8588b2ccf85444206480895bb067cd8c7366a558 100644 (file)
@@ -152,8 +152,6 @@ dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-#define dma_is_consistent(d, h)        (1)
-
 static inline void
 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
               enum dma_data_direction direction)
index 7b05ce14177e1e174a0dc2e48919c8f64caabc13..dfb811002c640fcc790aaecf47727a1c5f83c5fa 100644 (file)
@@ -125,8 +125,6 @@ int dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-#define dma_is_consistent(d, h)        (1)
-
 static inline
 void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                    enum dma_data_direction direction)
index 8d52deed375074ebce689808c95cb18ea0065dbf..a2e7368a01500bc742a3ee4e7b105a0b865de5ac 100644 (file)
@@ -97,6 +97,4 @@ dma_cache_sync (struct device *dev, void *vaddr, size_t size,
        mb();
 }
 
-#define dma_is_consistent(d, h)        (1)     /* all we do is coherent memory... */
-
 #endif /* _ASM_IA64_DMA_MAPPING_H */
index a1ae732c7247a64396f4ed383c1120ed7ebf30bb..17f7a45948eac7473b3afb16e86b5512d58a2c4d 100644 (file)
@@ -16,11 +16,6 @@ static inline int dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-static inline int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
-{
-       return 0;
-}
-
 extern void *dma_alloc_coherent(struct device *, size_t,
                                dma_addr_t *, gfp_t);
 extern void dma_free_coherent(struct device *, size_t,
index 21df7cbae65eb4627fb30245dd7186071ca1280b..8fbb0ec10233afb4b7a8c585015161ffe93c26d3 100644 (file)
@@ -106,7 +106,6 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 
 #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)
 
 static inline void *dma_alloc_coherent(struct device *dev, size_t size,
                                        dma_addr_t *dma_handle, gfp_t flag)
index d724a15f04380d0ec7e81f45ac0900705fe64cdf..18fbf7af8e93c2fa182b4906a66dfa25c3e17d00 100644 (file)
@@ -62,8 +62,6 @@ dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-extern int dma_is_consistent(struct device *dev, dma_addr_t dma_addr);
-
 extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
               enum dma_data_direction direction);
 
index 9547bc0cf188bc2cff41233e67b53ce5bdd0d50c..7ba890860d98cb3916c84f369e3fef0200b07f2b 100644 (file)
@@ -357,13 +357,6 @@ int dma_supported(struct device *dev, u64 mask)
 
 EXPORT_SYMBOL(dma_supported);
 
-int dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
-{
-       return plat_device_is_coherent(dev);
-}
-
-EXPORT_SYMBOL(dma_is_consistent);
-
 void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
               enum dma_data_direction direction)
 {
index 8d452a657795e80176c44e2d2f0b40b7a735b7c5..c1be4397b1edb4b059e917331c5ef8173bcf1096 100644 (file)
@@ -161,8 +161,6 @@ int dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-#define dma_is_consistent(d)   (1)
-
 static inline
 void dma_cache_sync(void *vaddr, size_t size,
                    enum dma_data_direction direction)
index 44d3f62ccf9d9ffac0d1010090a4246173e10799..4ef73b09b1681db7aaef8ce95a4f8f1ea7db1349 100644 (file)
@@ -184,12 +184,6 @@ dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-static inline int
-dma_is_consistent(struct device *dev, dma_addr_t dma_addr)
-{
-       return (hppa_dma_ops->dma_sync_single_for_cpu == NULL);
-}
-
 static inline void
 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
               enum dma_data_direction direction)
index a77ba280af04d576363799ccf6c7123a03410d67..8c9c6ad2004ea1f47ce3e5009da4bf9245131327 100644 (file)
@@ -209,11 +209,6 @@ static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
 
 #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)
-#ifdef CONFIG_NOT_COHERENT_CACHE
-#define dma_is_consistent(d, h)        (0)
-#else
-#define dma_is_consistent(d, h)        (1)
-#endif
 
 static inline void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
                enum dma_data_direction direction)
index 6bb5cc9decf85fa5c6d8cf762cb7e09d7f842757..1a73c3e759a79d2a6b5c443bd225309d786e0b06 100644 (file)
@@ -42,12 +42,6 @@ void dma_cache_sync(struct device *dev, void *vaddr, size_t size,
 #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)
 
-#ifdef CONFIG_DMA_COHERENT
-#define dma_is_consistent(d, h) (1)
-#else
-#define dma_is_consistent(d, h) (0)
-#endif
-
 static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 {
        struct dma_map_ops *ops = get_dma_ops(dev);
index 74db853ec2cf160c2c20ff8dbef9a8ce0239b700..8c0e4f7bb20484a674f663f30bf34789be6877d9 100644 (file)
@@ -11,7 +11,6 @@ extern int dma_supported(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)
 
 extern struct dma_map_ops *dma_ops, pci32_dma_ops;
 extern struct bus_type pci_bus_type;
index 1326b910fec67e68896c0ea620b18e9ef1176f5b..15e1dceecc646186d21a95eebf372ab5cc9f42cb 100644 (file)
@@ -90,6 +90,4 @@ dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-#define dma_is_consistent(d, h)        (1)
-
 #endif /* _ASM_TILE_DMA_MAPPING_H */
index b948c14a7867b309819dd50d1a90ea57963851dd..17a2cb5a4178ba6d99a1f2d5c56b6deaf5525fa3 100644 (file)
@@ -94,7 +94,6 @@ dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems,
 
 #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)
 
 static inline int
 dma_get_cache_alignment(void)
index f9c67e83f6488844902132f7ca7dffcb3cb08489..d4c419f883a03551aa2041a9ae7eb4fecac75bce 100644 (file)
@@ -54,7 +54,6 @@ static inline int dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
 
 #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)
 
 extern int dma_supported(struct device *hwdev, u64 mask);
 extern int dma_set_mask(struct device *dev, u64 mask);
index 7104f2f9823e7ebf9adae253a5bf68a88f6cd7d6..492c95790ad5ac2072ab60720ee6469d53e5d0f0 100644 (file)
@@ -161,8 +161,6 @@ dma_set_mask(struct device *dev, u64 mask)
        return 0;
 }
 
-#define dma_is_consistent(d, h)        (1)
-
 static inline void
 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
               enum dma_data_direction direction)
index 82cd0cb1c3fe0100f6a0194491324e11d6deb95b..ccf7b4f34a3c4e070fb44cd7456c859ee5c3c645 100644 (file)
@@ -72,9 +72,6 @@ dma_set_mask(struct device *dev, u64 mask);
 extern int
 dma_get_cache_alignment(void);
 
-extern int
-dma_is_consistent(struct device *dev, dma_addr_t dma_handle);
-
 extern void
 dma_cache_sync(struct device *dev, void *vaddr, size_t size,
               enum dma_data_direction direction);