From: Andres Urian Florez Date: Fri, 18 Apr 2025 17:14:24 +0000 (-0500) Subject: spi: offload: remove unnecessary check on trigger->ops X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=296e8d289bdd7eb0d832683ebd3e847fbb4c1b12;p=users%2Fwilly%2Flinux.git 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 --- diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c index 21a0f3a3a176..e674097bf3be 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)