]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ipath/ipath_dma.c
device create: infiniband: convert device_create_drvdata to device_create
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ipath / ipath_dma.c
index f87f003e3ef887845d6d0da293b7df24f6874da4..e90a0ea538a05b75b3fe0ca06edcda968bb4d364 100644 (file)
@@ -30,6 +30,7 @@
  * SOFTWARE.
  */
 
+#include <linux/scatterlist.h>
 #include <rdma/ib_verbs.h>
 
 #include "ipath_verbs.h"
@@ -96,17 +97,18 @@ static void ipath_dma_unmap_page(struct ib_device *dev,
        BUG_ON(!valid_dma_direction(direction));
 }
 
-static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sg, int nents,
-                       enum dma_data_direction direction)
+static int ipath_map_sg(struct ib_device *dev, struct scatterlist *sgl,
+                       int nents, enum dma_data_direction direction)
 {
+       struct scatterlist *sg;
        u64 addr;
        int i;
        int ret = nents;
 
        BUG_ON(!valid_dma_direction(direction));
 
-       for (i = 0; i < nents; i++) {
-               addr = (u64) page_address(sg[i].page);
+       for_each_sg(sgl, sg, nents, i) {
+               addr = (u64) page_address(sg_page(sg));
                /* TODO: handle highmem pages */
                if (!addr) {
                        ret = 0;
@@ -125,7 +127,7 @@ static void ipath_unmap_sg(struct ib_device *dev,
 
 static u64 ipath_sg_dma_address(struct ib_device *dev, struct scatterlist *sg)
 {
-       u64 addr = (u64) page_address(sg->page);
+       u64 addr = (u64) page_address(sg_page(sg));
 
        if (addr)
                addr += sg->offset;