aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/alpha/kernel/pci-noop.c14
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,
172EXPORT_SYMBOL(dma_alloc_coherent); 173EXPORT_SYMBOL(dma_alloc_coherent);
173 174
174int 175int
175dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, 176dma_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;