diff options
author | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2010-03-10 18:23:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:42 -0500 |
commit | 6a1961f49ee8d7339ea2454443dfc0460e0b2748 (patch) | |
tree | 057b03936a7dac1fd88d94c963bc52c3619c0022 /include/linux/dma-mapping.h | |
parent | e3c4bccabaf3e5c13f4b307c7737cbe8d0cecd02 (diff) |
dma-mapping: dma-mapping.h: add dma_set_coherent_mask
dma_set_coherent_mask corresponds to pci_set_consistent_dma_mask. This is
necessary to move to the generic device model DMA API from the PCI bus
specific API in the long term.
dma_set_coherent_mask works in the exact same way that
pci_set_consistent_dma_mask does. So this patch also changes
pci_set_consistent_dma_mask to call dma_set_coherent_mask.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: James Bottomley <James.Bottomley@suse.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/dma-mapping.h')
-rw-r--r-- | include/linux/dma-mapping.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index c5ac9d49cc06..ca32ed78b057 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -127,6 +127,14 @@ static inline u64 dma_get_mask(struct device *dev) | |||
127 | return DMA_BIT_MASK(32); | 127 | return DMA_BIT_MASK(32); |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline int dma_set_coherent_mask(struct device *dev, u64 mask) | ||
131 | { | ||
132 | if (!dma_supported(dev, mask)) | ||
133 | return -EIO; | ||
134 | dev->coherent_dma_mask = mask; | ||
135 | return 0; | ||
136 | } | ||
137 | |||
130 | extern u64 dma_get_required_mask(struct device *dev); | 138 | extern u64 dma_get_required_mask(struct device *dev); |
131 | 139 | ||
132 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | 140 | static inline unsigned int dma_get_max_seg_size(struct device *dev) |