]> www.infradead.org Git - users/willy/linux.git/commitdiff
spi: offload: remove unnecessary check on trigger->ops
authorAndres Urian Florez <andres.emb.sys@gmail.com>
Fri, 18 Apr 2025 17:14:24 +0000 (12:14 -0500)
committerMark Brown <broonie@kernel.org>
Mon, 21 Apr 2025 16:22:30 +0000 (17:22 +0100)
Considering that trigger->ops = NULL happens only when the trigger is
being removed from the list, and at that point the operation is protected
with the spi_offload_triggers_lock, it is possible to remove the
!trigger->ops check because it will never be true in
spi_offload_trigger_get()

Signed-off-by: Andres Urian Florez <andres.emb.sys@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250418171426.9868-1-andres.emb.sys@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-offload.c

index 21a0f3a3a1762b29bb6599558187e67c183739e5..e674097bf3be307051c5b80a1c8666bd7f33a121 100644 (file)
@@ -183,9 +183,6 @@ static struct spi_offload_trigger
 
        guard(mutex)(&trigger->lock);
 
-       if (!trigger->ops)
-               return ERR_PTR(-ENODEV);
-
        if (trigger->ops->request) {
                ret = trigger->ops->request(trigger, type, args->args, args->nargs);
                if (ret)