]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - lib/swiotlb.c
[SCSI] add missing transport configure points for target and host
[linux-2.6-omap-h63xx.git] / lib / swiotlb.c
index c419ecf334c30a063374b0cced7cbad8afeed7bc..1a8050ade86159877fd6eb4486954c7719bfc28d 100644 (file)
@@ -35,7 +35,7 @@
 #define OFFSET(val,align) ((unsigned long)     \
                           ( (val) & ( (align) - 1)))
 
-#define SG_ENT_VIRT_ADDRESS(sg)        (page_address((sg)->page) + (sg)->offset)
+#define SG_ENT_VIRT_ADDRESS(sg)        (sg_virt((sg)))
 #define SG_ENT_PHYS_ADDRESS(sg)        virt_to_bus(SG_ENT_VIRT_ADDRESS(sg))
 
 /*
@@ -696,7 +696,7 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems,
                                /* Don't panic here, we expect map_sg users
                                   to do proper error handling. */
                                swiotlb_full(hwdev, sg->length, dir, 0);
-                               swiotlb_unmap_sg(hwdev, sg - i, i, dir);
+                               swiotlb_unmap_sg(hwdev, sgl, i, dir);
                                sgl[0].dma_length = 0;
                                return 0;
                        }