Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
[platform/kernel/linux-rpi.git] / include / kunit / test.h
index 35b0aed..24b40e5 100644 (file)
@@ -540,8 +540,9 @@ kunit_find_resource(struct kunit *test,
                    void *match_data)
 {
        struct kunit_resource *res, *found = NULL;
+       unsigned long flags;
 
-       spin_lock(&test->lock);
+       spin_lock_irqsave(&test->lock, flags);
 
        list_for_each_entry_reverse(res, &test->resources, node) {
                if (match(test, res, (void *)match_data)) {
@@ -551,7 +552,7 @@ kunit_find_resource(struct kunit *test,
                }
        }
 
-       spin_unlock(&test->lock);
+       spin_unlock_irqrestore(&test->lock, flags);
 
        return found;
 }