mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/4] ASoC: cs35l45: Checks index of cs35l45_irqs[]
@ 2023-08-30 19:55 Vlad Karpovich
  2023-08-30 19:55 ` [PATCH v2 2/4] ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls Vlad Karpovich
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Vlad Karpovich @ 2023-08-30 19:55 UTC (permalink / raw)
  To: James Schulman, David Rhodes, Richard Fitzgerald, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Rob Herring
  Cc: alsa-devel, patches, linux-kernel, devicetree, Vlad Karpovich,
	Ricardo Rivera-Matos

Checks the index computed by the virq offset before printing the
error condition in cs35l45_spk_safe_err() handler.

Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
---
 sound/soc/codecs/cs35l45.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c
index 2ac4612402eb..02b1172d2647 100644
--- a/sound/soc/codecs/cs35l45.c
+++ b/sound/soc/codecs/cs35l45.c
@@ -1023,7 +1023,10 @@ static irqreturn_t cs35l45_spk_safe_err(int irq, void *data)
 
 	i = irq - regmap_irq_get_virq(cs35l45->irq_data, 0);
 
-	dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name);
+	if (i < 0 || i >= ARRAY_SIZE(cs35l45_irqs))
+		dev_err(cs35l45->dev, "Unspecified global error condition (%d) detected!\n", irq);
+	else
+		dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name);
 
 	return IRQ_HANDLED;
 }
-- 
2.25.1


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

end of thread, other threads:[~2023-08-31 16:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-30 19:55 [PATCH v2 1/4] ASoC: cs35l45: Checks index of cs35l45_irqs[] Vlad Karpovich
2023-08-30 19:55 ` [PATCH v2 2/4] ASoC: cs35l45: Analog PCM Volume and Amplifier Mode controls Vlad Karpovich
2023-08-30 19:55 ` [PATCH v2 3/4] ASoC: cs35l45: Connect DSP to the monitoring signals Vlad Karpovich
2023-08-30 19:55 ` [PATCH v2 4/4] ASoC: cs35l45: Add AMP Enable Switch control Vlad Karpovich
2023-08-30 20:59 ` [PATCH v2 1/4] ASoC: cs35l45: Checks index of cs35l45_irqs[] Mark Brown
2023-08-31 14:56   ` Rivera-Matos, Ricardo
2023-08-31 15:22     ` Richard Fitzgerald
2023-08-31 16:05       ` Mark Brown
2023-08-31 16:08         ` Vlad Karpovich

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

all inboxes | Powered by JetHome®