Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / arch / sparc / mm / iommu.c
index 52e907a..4b93427 100644 (file)
@@ -12,8 +12,8 @@
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/highmem.h>     /* pte_offset_map => kmap_atomic */
+#include <linux/scatterlist.h>
 
-#include <asm/scatterlist.h>
 #include <asm/pgalloc.h>
 #include <asm/pgtable.h>
 #include <asm/sbus.h>
@@ -238,9 +238,9 @@ static void iommu_get_scsi_sgl_noflush(struct scatterlist *sg, int sz, struct sb
        while (sz != 0) {
                --sz;
                n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
-               sg->dvma_address = iommu_get_one(sg->page, n, sbus) + sg->offset;
+               sg->dvma_address = iommu_get_one(sg_page(sg), n, sbus) + sg->offset;
                sg->dvma_length = (__u32) sg->length;
-               sg++;
+               sg = sg_next(sg);
        }
 }
 
@@ -252,9 +252,9 @@ static void iommu_get_scsi_sgl_gflush(struct scatterlist *sg, int sz, struct sbu
        while (sz != 0) {
                --sz;
                n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
-               sg->dvma_address = iommu_get_one(sg->page, n, sbus) + sg->offset;
+               sg->dvma_address = iommu_get_one(sg_page(sg), n, sbus) + sg->offset;
                sg->dvma_length = (__u32) sg->length;
-               sg++;
+               sg = sg_next(sg);
        }
 }
 
@@ -273,7 +273,7 @@ static void iommu_get_scsi_sgl_pflush(struct scatterlist *sg, int sz, struct sbu
                 * XXX Is this a good assumption?
                 * XXX What if someone else unmaps it here and races us?
                 */
-               if ((page = (unsigned long) page_address(sg->page)) != 0) {
+               if ((page = (unsigned long) page_address(sg_page(sg))) != 0) {
                        for (i = 0; i < n; i++) {
                                if (page != oldpage) {  /* Already flushed? */
                                        flush_page_for_dma(page);
@@ -283,9 +283,9 @@ static void iommu_get_scsi_sgl_pflush(struct scatterlist *sg, int sz, struct sbu
                        }
                }
 
-               sg->dvma_address = iommu_get_one(sg->page, n, sbus) + sg->offset;
+               sg->dvma_address = iommu_get_one(sg_page(sg), n, sbus) + sg->offset;
                sg->dvma_length = (__u32) sg->length;
-               sg++;
+               sg = sg_next(sg);
        }
 }
 
@@ -325,7 +325,7 @@ static void iommu_release_scsi_sgl(struct scatterlist *sg, int sz, struct sbus_b
                n = (sg->length + sg->offset + PAGE_SIZE-1) >> PAGE_SHIFT;
                iommu_release_one(sg->dvma_address & PAGE_MASK, n, sbus);
                sg->dvma_address = 0x21212121;
-               sg++;
+               sg = sg_next(sg);
        }
 }