]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
iio: buffer-dma: Use lockdep for locking annotations
authorNuno Sá <nuno.sa@analog.com>
Fri, 19 Dec 2025 15:28:12 +0000 (15:28 +0000)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 21 Dec 2025 11:54:39 +0000 (11:54 +0000)
Don't use mutex_is_locked() + WARN_ON() for checking if a specif lock is
taken. Instead use the existing annotations which means
lockdep_assert_held().

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/buffer/industrialio-buffer-dma.c

index 7a7a9d37339bc1c2ffec58687a42dde16b1412bb..8906feaeb69bcd48a31a92082bfbceb03a5059a5 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <linux/atomic.h>
 #include <linux/cleanup.h>
+#include <linux/lockdep.h>
 #include <linux/slab.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
@@ -764,7 +765,7 @@ int iio_dma_buffer_enqueue_dmabuf(struct iio_buffer *buffer,
        bool cookie;
        int ret;
 
-       WARN_ON(!mutex_is_locked(&queue->lock));
+       lockdep_assert_held(&queue->lock);
 
        cookie = dma_fence_begin_signalling();