diff options
| author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2026-04-09 19:43:27 +0300 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-04-09 21:39:31 +0300 |
| commit | 87ceac0a98e92f4efd031b5b9ab49ab5645d1c7e (patch) | |
| tree | fc32538236c445d6f65e08843c021fe317bbc138 | |
| parent | 7936490e04733ade80d0d445529c0a6de0f95515 (diff) | |
| download | linux-87ceac0a98e92f4efd031b5b9ab49ab5645d1c7e.tar.xz | |
ASoC: SDCA: Tidy up irq_enable_flags()/sdca_irq_disable()
In irq_enable_flags() and sdca_irq_disable() there is a NULL
check on the interrupt data pointer, however this is just pulled
from an array so can never be NULL. This was likely left over
from an earlier version that looked up the data in a different
way. Replace the check with checking for the IRQ itself being
non-zero.
Whilst here also drop the sdca_interrupt structure down into
the loop within the function to better match the style of the
rest of the code in this file.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20260409164328.3999434-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
| -rw-r--r-- | sound/soc/sdca/sdca_interrupts.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/soc/sdca/sdca_interrupts.c b/sound/soc/sdca/sdca_interrupts.c index 475aebcafe3f..3d7eb1996724 100644 --- a/sound/soc/sdca/sdca_interrupts.c +++ b/sound/soc/sdca/sdca_interrupts.c @@ -630,13 +630,12 @@ EXPORT_SYMBOL_NS_GPL(sdca_irq_allocate, "SND_SOC_SDCA"); static void irq_enable_flags(struct sdca_function_data *function, struct sdca_interrupt_info *info, bool early) { - struct sdca_interrupt *interrupt; int i; for (i = 0; i < SDCA_MAX_INTERRUPTS; i++) { - interrupt = &info->irqs[i]; + struct sdca_interrupt *interrupt = &info->irqs[i]; - if (!interrupt || interrupt->function != function) + if (!interrupt->irq || interrupt->function != function) continue; switch (SDCA_CTL_TYPE(interrupt->entity->type, @@ -689,13 +688,12 @@ EXPORT_SYMBOL_NS_GPL(sdca_irq_enable, "SND_SOC_SDCA"); void sdca_irq_disable(struct sdca_function_data *function, struct sdca_interrupt_info *info) { - struct sdca_interrupt *interrupt; int i; for (i = 0; i < SDCA_MAX_INTERRUPTS; i++) { - interrupt = &info->irqs[i]; + struct sdca_interrupt *interrupt = &info->irqs[i]; - if (!interrupt || interrupt->function != function) + if (!interrupt->irq || interrupt->function != function) continue; disable_irq(interrupt->irq); |
