mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] ASoC: meson: axg-fifo: return a negative error code when no irq is found
@ 2026-10-09  5:17 Haotian Zhang
  2026-10-09  5:24 ` sashiko-bot
  2026-10-09  6:07 ` Krzysztof Kozlowski
  0 siblings, 2 replies; 3+ messages in thread
From: Haotian Zhang @ 2026-10-09  5:17 UTC (permalink / raw)
  To: Jerome Brunet, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Neil Armstrong, Kevin Hilman, Martin Blumenstingl
  Cc: linux-sound, linux-arm-kernel, linux-amlogic, linux-kernel

In axg_fifo_probe(), of_irq_get() returns 0 when irq_create_of_mapping()
fails to map the interrupt. The error path explicitly treats this as a
failure with "if (fifo->irq <= 0)" and logs "failed to get irq: 0", but
then returns fifo->irq as-is. probe() therefore succeeds with fifo->irq
set to 0, and the failure is only reported much later when
axg_fifo_pcm_open() calls request_threaded_irq() with irq 0.

Return -EINVAL instead of 0, keeping the real negative error codes
untouched.

Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")
Assisted-by: DeepSeek-V4.1-Flash
Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
---
 sound/soc/meson/axg-fifo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
index 75909196b769..fdbee44f5101 100644
--- a/sound/soc/meson/axg-fifo.c
+++ b/sound/soc/meson/axg-fifo.c
@@ -365,7 +365,7 @@ int axg_fifo_probe(struct platform_device *pdev)
 	fifo->irq = of_irq_get(dev->of_node, 0);
 	if (fifo->irq <= 0) {
 		dev_err(dev, "failed to get irq: %d\n", fifo->irq);
-		return fifo->irq;
+		return fifo->irq ?: -EINVAL;
 	}
 
 	fifo->field_threshold =
-- 
2.25.1


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2026-10-09  6:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09  5:17 [PATCH] ASoC: meson: axg-fifo: return a negative error code when no irq is found Haotian Zhang
2026-10-09  5:24 ` sashiko-bot
2026-10-09  6:07 ` Krzysztof Kozlowski

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®