* [PATCH] ASoC: renesas: fsi: Propagate platform_get_irq() errors
@ 2026-06-29 9:53 Narasimharao Vadlamudi
2026-06-29 23:33 ` Kuninori Morimoto
2026-06-30 15:44 ` Geert Uytterhoeven
0 siblings, 2 replies; 3+ messages in thread
From: Narasimharao Vadlamudi @ 2026-06-29 9:53 UTC (permalink / raw)
To: kuninori.morimoto.gx, broonie
Cc: linux-sound, linux-renesas-soc, linux-kernel, Narasimharao Vadlamudi
platform_get_irq() returns a negative error code on failure. The
driver currently stores the return value in an unsigned int and returns
-ENODEV for all failures, which loses useful errors such as
-EPROBE_DEFER.
Store the IRQ in an int and return the error from platform_get_irq()
directly.
Signed-off-by: Narasimharao Vadlamudi <ahmisaranrao@gmail.com>
---
sound/soc/renesas/fsi.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/sound/soc/renesas/fsi.c b/sound/soc/renesas/fsi.c
index ae86014c3819..6be6587e1095 100644
--- a/sound/soc/renesas/fsi.c
+++ b/sound/soc/renesas/fsi.c
@@ -1992,7 +1992,7 @@ static int fsi_probe(struct platform_device *pdev)
const struct fsi_core *core;
struct fsi_priv *fsi;
struct resource *res;
- unsigned int irq;
+ int irq;
int ret;
memset(&info, 0, sizeof(info));
@@ -2007,12 +2007,15 @@ static int fsi_probe(struct platform_device *pdev)
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- irq = platform_get_irq(pdev, 0);
- if (!res || (int)irq <= 0) {
+ if (!res) {
dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
return -ENODEV;
}
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0)
+ return irq;
+
master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
if (!master)
return -ENOMEM;
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: renesas: fsi: Propagate platform_get_irq() errors
2026-06-29 9:53 [PATCH] ASoC: renesas: fsi: Propagate platform_get_irq() errors Narasimharao Vadlamudi
@ 2026-06-29 23:33 ` Kuninori Morimoto
2026-06-30 15:44 ` Geert Uytterhoeven
1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2026-06-29 23:33 UTC (permalink / raw)
To: Narasimharao Vadlamudi
Cc: broonie, linux-sound, linux-renesas-soc, linux-kernel
Hi Narasimharao
> platform_get_irq() returns a negative error code on failure. The
> driver currently stores the return value in an unsigned int and returns
> -ENODEV for all failures, which loses useful errors such as
> -EPROBE_DEFER.
>
> Store the IRQ in an int and return the error from platform_get_irq()
> directly.
>
> Signed-off-by: Narasimharao Vadlamudi <ahmisaranrao@gmail.com>
> ---
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Thank you for your help !!
Best regards
---
Kuninori Morimoto
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: renesas: fsi: Propagate platform_get_irq() errors
2026-06-29 9:53 [PATCH] ASoC: renesas: fsi: Propagate platform_get_irq() errors Narasimharao Vadlamudi
2026-06-29 23:33 ` Kuninori Morimoto
@ 2026-06-30 15:44 ` Geert Uytterhoeven
1 sibling, 0 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2026-06-30 15:44 UTC (permalink / raw)
To: Narasimharao Vadlamudi
Cc: kuninori.morimoto.gx, broonie, linux-sound, linux-renesas-soc,
linux-kernel
Hi Narasimharao,
On Mon, 29 Jun 2026 at 18:25, Narasimharao Vadlamudi
<ahmisaranrao@gmail.com> wrote:
> platform_get_irq() returns a negative error code on failure. The
> driver currently stores the return value in an unsigned int and returns
> -ENODEV for all failures, which loses useful errors such as
> -EPROBE_DEFER.
>
> Store the IRQ in an int and return the error from platform_get_irq()
> directly.
>
> Signed-off-by: Narasimharao Vadlamudi <ahmisaranrao@gmail.com>
Thanks for your patch!
> --- a/sound/soc/renesas/fsi.c
> +++ b/sound/soc/renesas/fsi.c
> @@ -1992,7 +1992,7 @@ static int fsi_probe(struct platform_device *pdev)
> const struct fsi_core *core;
> struct fsi_priv *fsi;
> struct resource *res;
> - unsigned int irq;
> + int irq;
> int ret;
>
> memset(&info, 0, sizeof(info));
> @@ -2007,12 +2007,15 @@ static int fsi_probe(struct platform_device *pdev)
> }
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - irq = platform_get_irq(pdev, 0);
> - if (!res || (int)irq <= 0) {
This check also covered irq == 0, but that can indeed no longer happen.
Might be good to mention that in the commit message.
> + if (!res) {
> dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
> return -ENODEV;
> }
>
> + irq = platform_get_irq(pdev, 0);
> + if (irq < 0)
> + return irq;
> +
> master = devm_kzalloc(&pdev->dev, sizeof(*master), GFP_KERNEL);
> if (!master)
> return -ENOMEM;
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-30 15:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 9:53 [PATCH] ASoC: renesas: fsi: Propagate platform_get_irq() errors Narasimharao Vadlamudi
2026-06-29 23:33 ` Kuninori Morimoto
2026-06-30 15:44 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox