iio: buffer-dma: Use lockdep for locking annotations

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>
This commit is contained in:
Nuno Sá 2025-12-19 15:28:12 +00:00 committed by Jonathan Cameron
parent 0a272aaf5f
commit 09ccc1b65c

View 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();