summaryrefslogtreecommitdiffstats
path: root/lib/swiotlb.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-12-31 10:27:22 -0800
committerSteve French <sfrench@us.ibm.com>2005-12-31 10:27:22 -0800
commiteea60caef610c7a6c58c0de9c80ae1e438e01301 (patch)
tree25e19289bba003fe085e589430d0d981fd6b73a7 /lib/swiotlb.c
parentda8543ef125afc7bba4da526b61a1ae07dc25109 (diff)
parent82c9df820112c6286a8e8fbe482e94b65b49062c (diff)
downloadkernel-crypto-eea60caef610c7a6c58c0de9c80ae1e438e01301.tar.gz
kernel-crypto-eea60caef610c7a6c58c0de9c80ae1e438e01301.tar.xz
kernel-crypto-eea60caef610c7a6c58c0de9c80ae1e438e01301.zip
Merge with /pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'lib/swiotlb.c')
-rw-r--r--lib/swiotlb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 57216f3544c..1ff8dcebf7c 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -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);