diff options
author | FUJITA Tomonori <tomof@acm.org> | 2007-11-21 12:26:31 +0100 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2007-11-27 09:19:39 +0100 |
commit | 8c8d7214d1b35726e950db1f73317e28e827f1cd (patch) | |
tree | 4e3be075ebf3cff70a979f3f8f149157346791f2 /arch/alpha/kernel | |
parent | 35fc51e7a5056889421270c1fb63d8ec45fbccf4 (diff) | |
download | kernel_samsung_aries-8c8d7214d1b35726e950db1f73317e28e827f1cd.zip kernel_samsung_aries-8c8d7214d1b35726e950db1f73317e28e827f1cd.tar.gz kernel_samsung_aries-8c8d7214d1b35726e950db1f73317e28e827f1cd.tar.bz2 |
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>
Diffstat (limited to 'arch/alpha/kernel')
-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 174b729..468b76c 100644 --- a/arch/alpha/kernel/pci-noop.c +++ b/arch/alpha/kernel/pci-noop.c @@ -12,6 +12,7 @@ #include <linux/errno.h> #include <linux/sched.h> #include <linux/dma-mapping.h> +#include <linux/scatterlist.h> #include "proto.h" @@ -172,18 +173,19 @@ dma_alloc_coherent(struct device *dev, size_t size, EXPORT_SYMBOL(dma_alloc_coherent); int -dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, +dma_map_sg(struct device *dev, struct scatterlist *sgl, int nents, enum dma_data_direction direction) { int i; + struct scatterlist *sg; - for (i = 0; i < nents; i++ ) { + for_each_sg(sgl, sg, nents, i) { void *va; - BUG_ON(!sg[i].page); - va = page_address(sg[i].page) + sg[i].offset; - sg_dma_address(sg + i) = (dma_addr_t)virt_to_bus(va); - sg_dma_len(sg + i) = sg[i].length; + BUG_ON(!sg_page(sg)); + va = sg_virt(sg); + sg_dma_address(sg) = (dma_addr_t)virt_to_bus(va); + sg_dma_len(sg) = sg->length; } return nents; |