mirror of
https://github.com/torvalds/linux.git
synced 2026-06-01 11:03:43 +02:00
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: Andres Urian Florez <andres.emb.sys@gmail.com> Reviewed-by: David Lechner <dlechner@baylibre.com> Link: https://patch.msgid.link/20250418224750.46219-1-andres.emb.sys@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
cbc9d9e108
commit
fcab1637bb
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user