]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/pci-nommu.c
x86: move pci-nommu's dma_mask check to common code
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / pci-nommu.c
index b8ce83c982110c72e28aa9772bc068f93da59304..0f51883cc6a87171178f3f2fa571040dd2de7d18 100644 (file)
@@ -80,9 +80,6 @@ nommu_alloc_coherent(struct device *hwdev, size_t size,
        int node;
        struct page *page;
 
-       if (hwdev->dma_mask == NULL)
-               return NULL;
-
        gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32);
        gfp |= __GFP_ZERO;
 
@@ -126,8 +123,15 @@ again:
        return NULL;
 }
 
+static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr,
+                               dma_addr_t dma_addr)
+{
+       free_pages((unsigned long)vaddr, get_order(size));
+}
+
 struct dma_mapping_ops nommu_dma_ops = {
        .alloc_coherent = nommu_alloc_coherent,
+       .free_coherent = nommu_free_coherent,
        .map_single = nommu_map_single,
        .map_sg = nommu_map_sg,
        .is_phys = 1,