diff options
author | FUJITA Tomonori <tomof@acm.org> | 2007-11-21 06:26:31 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-11-27 03:19:39 -0500 |
commit | 8c8d7214d1b35726e950db1f73317e28e827f1cd (patch) | |
tree | 4e3be075ebf3cff70a979f3f8f149157346791f2 | |
parent | 35fc51e7a5056889421270c1fb63d8ec45fbccf4 (diff) |
alpha: fix sg_page breakage
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r-- | arch/alpha/kernel/pci-noop.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/alpha/kernel/pci-noop.c b/arch/alpha/kernel/pci-noop.c index 174b729c504b..468b76ce66a1 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/sched.h> | 13 | #include <linux/sched.h> |
14 | #include <linux/dma-mapping.h> | 14 | #include <linux/dma-mapping.h> |
15 | #include <linux/scatterlist.h> | ||
15 | 16 | ||
16 | #include "proto.h" | 17 | #include "proto.h" |
17 | 18 | ||
@@ -172,18 +173,19 @@ dma_alloc_coherent(struct device *dev, size_t size, | |||
172 | EXPORT_SYMBOL(dma_alloc_coherent); | 173 | EXPORT_SYMBOL(dma_alloc_coherent); |
173 | 174 | ||
174 | int | 175 | int |
175 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 176 | dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, |
176 | enum dma_data_direction direction) | 177 | enum dma_data_direction direction) |
177 | { | 178 | { |
178 | int i; | 179 | int i; |
180 | struct scatterlist *sg; | ||
179 | 181 | ||
180 | for (i = 0; i < nents; i++ ) { | 182 | for_each_sg(sgl, sg, nents, i) { |
181 | void *va; | 183 | void *va; |
182 | 184 | ||
183 | BUG_ON(!sg[i].page); | 185 | BUG_ON(!sg_page(sg)); |
184 | va = page_address(sg[i].page) + sg[i].offset; | 186 | va = sg_virt(sg); |
185 | sg_dma_address(sg + i) = (dma_addr_t)virt_to_bus(va); | 187 | sg_dma_address(sg) = (dma_addr_t)virt_to_bus(va); |
186 | sg_dma_len(sg + i) = sg[i].length; | 188 | sg_dma_len(sg) = sg->length; |
187 | } | 189 | } |
188 | 190 | ||
189 | return nents; | 191 | return nents; |