Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs35l56: Accept values greater than 0 as IRQ numbers
@ 2024-06-17 13:53 Simon Trimmer
  2024-06-17 14:04 ` Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Simon Trimmer @ 2024-06-17 13:53 UTC (permalink / raw)
  To: broonie; +Cc: linux-sound, alsa-devel, linux-kernel, patches, Simon Trimmer

IRQ lookup functions such as those in ACPI can return error values when
an IRQ is not defined. The i2c core driver converts the error codes to a
value of 0 and the SPI bus driver passes them unaltered to client device
drivers.

The cs35l56 driver should only accept positive non-zero values as IRQ
numbers.

Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Fixes: 8a731fd37f8b ("ASoC: cs35l56: Move utility functions to shared file")
---
 sound/soc/codecs/cs35l56-shared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index 27869e14e9c8..880228f89baf 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -397,7 +397,7 @@ int cs35l56_irq_request(struct cs35l56_base *cs35l56_base, int irq)
 {
 	int ret;
 
-	if (!irq)
+	if (irq < 1)
 		return 0;
 
 	ret = devm_request_threaded_irq(cs35l56_base->dev, irq, NULL, cs35l56_irq,
-- 
2.34.1


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

end of thread, other threads:[~2024-06-19 13:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-17 13:53 [PATCH] ASoC: cs35l56: Accept values greater than 0 as IRQ numbers Simon Trimmer
2024-06-17 14:04 ` Mark Brown
2024-06-17 14:33   ` Richard Fitzgerald
2024-06-17 14:48     ` Simon Trimmer
2024-06-17 14:54       ` Richard Fitzgerald
2024-06-18 16:00         ` Mark Brown
2024-06-18 16:06           ` Richard Fitzgerald
2024-06-18 15:58     ` Mark Brown
2024-06-18 16:07       ` Richard Fitzgerald
2024-06-19  9:44 ` Richard Fitzgerald
2024-06-19 10:22   ` Mark Brown
2024-06-19 10:24     ` Richard Fitzgerald
2024-06-19 11:48       ` Mark Brown
2024-06-19 13:50 ` Mark Brown

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