From 296e8d289bdd7eb0d832683ebd3e847fbb4c1b12 Mon Sep 17 00:00:00 2001 From: Andres Urian Florez Date: Fri, 18 Apr 2025 12:14:24 -0500 Subject: [PATCH] spi: offload: remove unnecessary check on trigger->ops 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 Reviewed-by: David Lechner Link: https://patch.msgid.link/20250418171426.9868-1-andres.emb.sys@gmail.com Signed-off-by: Mark Brown --- drivers/spi/spi-offload.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c index 21a0f3a3a1762..e674097bf3be3 100644 --- a/drivers/spi/spi-offload.c +++ b/drivers/spi/spi-offload.c @@ -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) -- 2.47.3