]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - lib/dma-debug.c
dma-debug: allow DMA_BIDIRECTIONAL mappings to be synced with DMA_FROM_DEVICE and
[karo-tx-linux.git] / lib / dma-debug.c
index cf906201aecfcece0a10b008a84ab6a08b6ba992..7d2f0b33e5a82937d2fb615fe5bbbb0de3884777 100644 (file)
@@ -913,6 +913,9 @@ static void check_sync(struct device *dev,
                                ref->size);
        }
 
+       if (entry->direction == DMA_BIDIRECTIONAL)
+               goto out;
+
        if (ref->direction != entry->direction) {
                err_printk(dev, entry, "DMA-API: device driver syncs "
                                "DMA memory with different direction "
@@ -923,9 +926,6 @@ static void check_sync(struct device *dev,
                                dir2name[ref->direction]);
        }
 
-       if (entry->direction == DMA_BIDIRECTIONAL)
-               goto out;
-
        if (to_cpu && !(entry->direction == DMA_FROM_DEVICE) &&
                      !(ref->direction == DMA_TO_DEVICE))
                err_printk(dev, entry, "DMA-API: device driver syncs "
@@ -948,7 +948,6 @@ static void check_sync(struct device *dev,
 
 out:
        put_hash_bucket(bucket, &flags);
-
 }
 
 void debug_dma_map_page(struct device *dev, struct page *page, size_t offset,