diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2007-10-23 06:52:48 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-10-23 06:52:48 -0400 |
commit | 71df50a4e4ca9934bbf520c87612d711278f38af (patch) | |
tree | 84a1d0be1abea617b18d1ae035e321b9c0b2a233 /include | |
parent | ebc3bbcfcf0a7fed2ac82f1a849a5f92cf4c217f (diff) |
sh/sh64: fixup dma-mapping for new sg layout
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sh/dma-mapping.h | 12 | ||||
-rw-r--r-- | include/asm-sh64/dma-mapping.h | 12 |
2 files changed, 10 insertions, 14 deletions
diff --git a/include/asm-sh/dma-mapping.h b/include/asm-sh/dma-mapping.h index 84fefdaa01a5..fcea067f7a9c 100644 --- a/include/asm-sh/dma-mapping.h +++ b/include/asm-sh/dma-mapping.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __ASM_SH_DMA_MAPPING_H | 2 | #define __ASM_SH_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <asm/scatterlist.h> | 5 | #include <linux/scatterlist.h> |
6 | #include <asm/cacheflush.h> | 6 | #include <asm/cacheflush.h> |
7 | #include <asm/io.h> | 7 | #include <asm/io.h> |
8 | 8 | ||
@@ -85,10 +85,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | |||
85 | 85 | ||
86 | for (i = 0; i < nents; i++) { | 86 | for (i = 0; i < nents; i++) { |
87 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 87 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
88 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, | 88 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); |
89 | sg[i].length, dir); | ||
90 | #endif | 89 | #endif |
91 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 90 | sg[i].dma_address = sg_phys(&sg[i]); |
92 | } | 91 | } |
93 | 92 | ||
94 | return nents; | 93 | return nents; |
@@ -138,10 +137,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | |||
138 | 137 | ||
139 | for (i = 0; i < nelems; i++) { | 138 | for (i = 0; i < nelems; i++) { |
140 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 139 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
141 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, | 140 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); |
142 | sg[i].length, dir); | ||
143 | #endif | 141 | #endif |
144 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 142 | sg[i].dma_address = sg_phys(&sg[i]); |
145 | } | 143 | } |
146 | } | 144 | } |
147 | 145 | ||
diff --git a/include/asm-sh64/dma-mapping.h b/include/asm-sh64/dma-mapping.h index e661857f98dc..1438b763a5ea 100644 --- a/include/asm-sh64/dma-mapping.h +++ b/include/asm-sh64/dma-mapping.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __ASM_SH_DMA_MAPPING_H | 2 | #define __ASM_SH_DMA_MAPPING_H |
3 | 3 | ||
4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
5 | #include <asm/scatterlist.h> | 5 | #include <linux/scatterlist.h> |
6 | #include <asm/io.h> | 6 | #include <asm/io.h> |
7 | 7 | ||
8 | struct pci_dev; | 8 | struct pci_dev; |
@@ -71,10 +71,9 @@ static inline int dma_map_sg(struct device *dev, struct scatterlist *sg, | |||
71 | 71 | ||
72 | for (i = 0; i < nents; i++) { | 72 | for (i = 0; i < nents; i++) { |
73 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 73 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
74 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, | 74 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); |
75 | sg[i].length, dir); | ||
76 | #endif | 75 | #endif |
77 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 76 | sg[i].dma_address = sg_phys(&sg[i]); |
78 | } | 77 | } |
79 | 78 | ||
80 | return nents; | 79 | return nents; |
@@ -124,10 +123,9 @@ static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, | |||
124 | 123 | ||
125 | for (i = 0; i < nelems; i++) { | 124 | for (i = 0; i < nelems; i++) { |
126 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) | 125 | #if !defined(CONFIG_PCI) || defined(CONFIG_SH_PCIDMA_NONCOHERENT) |
127 | dma_cache_sync(dev, page_address(sg[i].page) + sg[i].offset, | 126 | dma_cache_sync(dev, sg_virt(&sg[i]), sg[i].length, dir); |
128 | sg[i].length, dir); | ||
129 | #endif | 127 | #endif |
130 | sg[i].dma_address = page_to_phys(sg[i].page) + sg[i].offset; | 128 | sg[i].dma_address = sg_phys(&sg[i]); |
131 | } | 129 | } |
132 | } | 130 | } |
133 | 131 | ||