]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - lib/swiotlb.c
Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik...
[linux-2.6-omap-h63xx.git] / lib / swiotlb.c
index 57216f3544cad435e2986df9d83b9dbf4ddf37ad..1ff8dcebf7c6edf33abb7eb2583d5b6eab37ce29 100644 (file)
@@ -704,8 +704,9 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems,
                addr = SG_ENT_VIRT_ADDRESS(sg);
                dev_addr = virt_to_phys(addr);
                if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) {
-                       sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir));
-                       if (!sg->dma_address) {
+                       void *map = map_single(hwdev, addr, sg->length, dir);
+                       sg->dma_address = virt_to_bus(map);
+                       if (!map) {
                                /* Don't panic here, we expect map_sg users
                                   to do proper error handling. */
                                swiotlb_full(hwdev, sg->length, dir, 0);