]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - lib/swiotlb.c
swiotlb: use map_single instead of swiotlb_map_single in swiotlb_alloc_coherent
[linux-2.6-omap-h63xx.git] / lib / swiotlb.c
index 977edbdbc1debada5937958f5835b1dc88c9beba..2fb485d0e7eb7d445a36288a86db658106ba1a08 100644 (file)
@@ -467,13 +467,6 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
        void *ret;
        int order = get_order(size);
 
-       /*
-        * XXX fix me: the DMA API should pass us an explicit DMA mask
-        * instead, or use ZONE_DMA32 (ia64 overloads ZONE_DMA to be a ~32
-        * bit range instead of a 16MB one).
-        */
-       flags |= GFP_DMA;
-
        ret = (void *)__get_free_pages(flags, order);
        if (ret && address_needs_mapping(hwdev, virt_to_bus(ret))) {
                /*
@@ -490,12 +483,9 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
                 * swiotlb_map_single(), which will grab memory from
                 * the lowest available address range.
                 */
-               dma_addr_t handle;
-               handle = swiotlb_map_single(NULL, NULL, size, DMA_FROM_DEVICE);
-               if (swiotlb_dma_mapping_error(hwdev, handle))
+               ret = map_single(hwdev, NULL, size, DMA_FROM_DEVICE);
+               if (!ret)
                        return NULL;
-
-               ret = bus_to_virt(handle);
        }
 
        memset(ret, 0, size);