* [PATCH] spi: offload: check offload ops existence before disabling the trigger
@ 2025-06-08 23:04 Andres Urian Florez
2025-06-09 13:46 ` David Lechner
2025-06-09 15:40 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Andres Urian Florez @ 2025-06-08 23:04 UTC (permalink / raw)
To: dlechner, broonie; +Cc: Andres Urian Florez, skhan, linux-spi
Add a safe guard in spi_offload_trigger to check the existence of
offload->ops before invoking the trigger_disable callback
Signed-off-by: Andres Urian Florez <andres.emb.sys@gmail.com>
---
drivers/spi/spi-offload.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c
index e674097bf3be..d336f4d228d5 100644
--- a/drivers/spi/spi-offload.c
+++ b/drivers/spi/spi-offload.c
@@ -297,7 +297,7 @@ int spi_offload_trigger_enable(struct spi_offload *offload,
if (trigger->ops->enable) {
ret = trigger->ops->enable(trigger, config);
if (ret) {
- if (offload->ops->trigger_disable)
+ if (offload->ops && offload->ops->trigger_disable)
offload->ops->trigger_disable(offload);
return ret;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] spi: offload: check offload ops existence before disabling the trigger
2025-06-08 23:04 [PATCH] spi: offload: check offload ops existence before disabling the trigger Andres Urian Florez
@ 2025-06-09 13:46 ` David Lechner
2025-06-09 15:40 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: David Lechner @ 2025-06-09 13:46 UTC (permalink / raw)
To: Andres Urian Florez, broonie; +Cc: skhan, linux-spi
On 6/8/25 6:04 PM, Andres Urian Florez wrote:
> Add a safe guard in spi_offload_trigger to check the existence of
> offload->ops before invoking the trigger_disable callback
>
> Signed-off-by: Andres Urian Florez <andres.emb.sys@gmail.com>
> ---
> drivers/spi/spi-offload.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-offload.c b/drivers/spi/spi-offload.c
> index e674097bf3be..d336f4d228d5 100644
> --- a/drivers/spi/spi-offload.c
> +++ b/drivers/spi/spi-offload.c
> @@ -297,7 +297,7 @@ int spi_offload_trigger_enable(struct spi_offload *offload,
> if (trigger->ops->enable) {
> ret = trigger->ops->enable(trigger, config);
> if (ret) {
> - if (offload->ops->trigger_disable)
> + if (offload->ops && offload->ops->trigger_disable)
> offload->ops->trigger_disable(offload);
> return ret;
> }
It would be unusual to have an enable callback without also having
a disable callback, but to be symmetric with the same call in
spi_offload_trigger_disable(), it seems fine to add this check.
Reviewed-by: David Lechner <dlechner@baylibre.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] spi: offload: check offload ops existence before disabling the trigger
2025-06-08 23:04 [PATCH] spi: offload: check offload ops existence before disabling the trigger Andres Urian Florez
2025-06-09 13:46 ` David Lechner
@ 2025-06-09 15:40 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-06-09 15:40 UTC (permalink / raw)
To: dlechner, Andres Urian Florez; +Cc: skhan, linux-spi
On Sun, 08 Jun 2025 18:04:21 -0500, Andres Urian Florez wrote:
> Add a safe guard in spi_offload_trigger to check the existence of
> offload->ops before invoking the trigger_disable callback
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: offload: check offload ops existence before disabling the trigger
commit: e51a086117ed857ea455c9ea774dbfb82f53e517
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-06-09 15:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 23:04 [PATCH] spi: offload: check offload ops existence before disabling the trigger Andres Urian Florez
2025-06-09 13:46 ` David Lechner
2025-06-09 15:40 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox