Unverified Commit fcab1637 authored by Andres Urian Florez's avatar Andres Urian Florez Committed by Mark Brown
Browse files

spi: offload: check for match callback when a trigger is being registered



Make match a required callback when a new trigger is being registered,
this allows that other functions like spi_offload_trigger_get() could
safely invoke the callback when it is required

In v2:
- improve readability of the condition

Signed-off-by: default avatarAndres Urian Florez <andres.emb.sys@gmail.com>
Reviewed-by: default avatarDavid Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250418224750.46219-1-andres.emb.sys@gmail.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent cbc9d9e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -434,7 +434,7 @@ int devm_spi_offload_trigger_register(struct device *dev,
{
	struct spi_offload_trigger *trigger;

	if (!info->fwnode || !info->ops)
	if (!info->fwnode || !info->ops || !info->ops->match)
		return -EINVAL;

	trigger = kzalloc(sizeof(*trigger), GFP_KERNEL);