Merge tag 'dmaengine-4.12-rc1' of git://git.infradead.org/users/vkoul/slave-dma
[sfrench/cifs-2.6.git] / lib / dma-debug.c
index cd5a5a426ef1f219e5091bacb77849c510d62241..ea4cc3dde4f1bac9f3b8337fdac95408cb3e8b35 100644 (file)
@@ -942,21 +942,17 @@ static int device_dma_allocations(struct device *dev, struct dma_debug_entry **o
        unsigned long flags;
        int count = 0, i;
 
-       local_irq_save(flags);
-
        for (i = 0; i < HASH_SIZE; ++i) {
-               spin_lock(&dma_entry_hash[i].lock);
+               spin_lock_irqsave(&dma_entry_hash[i].lock, flags);
                list_for_each_entry(entry, &dma_entry_hash[i].list, list) {
                        if (entry->dev == dev) {
                                count += 1;
                                *out_entry = entry;
                        }
                }
-               spin_unlock(&dma_entry_hash[i].lock);
+               spin_unlock_irqrestore(&dma_entry_hash[i].lock, flags);
        }
 
-       local_irq_restore(flags);
-
        return count;
 }