Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: offload: remove unnecessary check on trigger->ops
@ 2025-04-18 17:14 Andres Urian Florez
  2025-04-18 19:50 ` David Lechner
  2025-04-22 13:13 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Andres Urian Florez @ 2025-04-18 17:14 UTC (permalink / raw)
  To: dlechner, broonie; +Cc: Andres Urian Florez, skhan, linux-spi

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>
---
 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 6bad042fe437..c43264dc3900 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.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: offload: remove unnecessary check on trigger->ops
  2025-04-18 17:14 [PATCH] spi: offload: remove unnecessary check on trigger->ops Andres Urian Florez
@ 2025-04-18 19:50 ` David Lechner
  2025-04-22 13:13 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: David Lechner @ 2025-04-18 19:50 UTC (permalink / raw)
  To: Andres Urian Florez, broonie; +Cc: skhan, linux-spi

On 4/18/25 12:14 PM, Andres Urian Florez wrote:
> 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>
> ---

Thanks for the cleanup!

Reviewed-by: David Lechner <dlechner@baylibre.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: offload: remove unnecessary check on trigger->ops
  2025-04-18 17:14 [PATCH] spi: offload: remove unnecessary check on trigger->ops Andres Urian Florez
  2025-04-18 19:50 ` David Lechner
@ 2025-04-22 13:13 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-04-22 13:13 UTC (permalink / raw)
  To: dlechner, Andres Urian Florez; +Cc: skhan, linux-spi

On Fri, 18 Apr 2025 12:14:24 -0500, Andres Urian Florez wrote:
> 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()
> 
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: offload: remove unnecessary check on trigger->ops
      commit: 296e8d289bdd7eb0d832683ebd3e847fbb4c1b12

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-04-22 13:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-18 17:14 [PATCH] spi: offload: remove unnecessary check on trigger->ops Andres Urian Florez
2025-04-18 19:50 ` David Lechner
2025-04-22 13:13 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox