mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup
@ 2026-08-07 10:29 phucduc.bui
  2026-08-07 10:29 ` [PATCH 2/2] spi: mtk-nor: Propagate errors from IRQ request phucduc.bui
  2026-08-12 18:49 ` [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: phucduc.bui @ 2026-08-07 10:29 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: linux-spi, linux-kernel, linux-arm-kernel, linux-mediatek, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

platform_get_irq_optional() returns a positive IRQ number on success or
a negative error code on failure. For an optional IRQ, -ENXIO indicates
that no IRQ is available, while other errors should be propagated.

Propagate errors such as -EPROBE_DEFER and -EINVAL instead of continuing
probe without the IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/spi/spi-mtk-nor.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index 74f34537b02c..6b9a5d728549 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -895,6 +895,10 @@ static int mtk_nor_probe(struct platform_device *pdev)
 	irq = platform_get_irq_optional(pdev, 0);
 
 	if (irq < 0) {
+		if (irq != -ENXIO) {
+			ret = irq;
+			goto err_disable_clk;
+		}
 		dev_warn(sp->dev, "IRQ not available.");
 	} else {
 		ret = devm_request_irq(sp->dev, irq, mtk_nor_irq_handler, 0,
@@ -928,6 +932,7 @@ static int mtk_nor_probe(struct platform_device *pdev)
 	pm_runtime_set_suspended(&pdev->dev);
 	pm_runtime_dont_use_autosuspend(&pdev->dev);
 
+err_disable_clk:
 	mtk_nor_disable_clk(sp);
 
 	return ret;
-- 
2.43.0


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

* [PATCH 2/2] spi: mtk-nor: Propagate errors from IRQ request
  2026-08-07 10:29 [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup phucduc.bui
@ 2026-08-07 10:29 ` phucduc.bui
  2026-08-12 18:49 ` [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: phucduc.bui @ 2026-08-07 10:29 UTC (permalink / raw)
  To: Mark Brown, Matthias Brugger, AngeloGioacchino Del Regno
  Cc: linux-spi, linux-kernel, linux-arm-kernel, linux-mediatek, bui duc phuc

From: bui duc phuc <phucduc.bui@gmail.com>

Treat a failure from devm_request_irq() as a probe error instead of
continuing without an IRQ after only reporting a warning.

Return the error through the existing error path to ensure the driver
does not continue with an unsuccessfully requested IRQ.

Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
 drivers/spi/spi-mtk-nor.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spi-mtk-nor.c b/drivers/spi/spi-mtk-nor.c
index 6b9a5d728549..c1e15246120f 100644
--- a/drivers/spi/spi-mtk-nor.c
+++ b/drivers/spi/spi-mtk-nor.c
@@ -905,6 +905,7 @@ static int mtk_nor_probe(struct platform_device *pdev)
 				       pdev->name, sp);
 		if (ret < 0) {
 			dev_warn(sp->dev, "failed to request IRQ.");
+			goto err_disable_clk;
 		} else {
 			init_completion(&sp->op_done);
 			sp->has_irq = true;
-- 
2.43.0


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

* Re: [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup
  2026-08-07 10:29 [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup phucduc.bui
  2026-08-07 10:29 ` [PATCH 2/2] spi: mtk-nor: Propagate errors from IRQ request phucduc.bui
@ 2026-08-12 18:49 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-08-12 18:49 UTC (permalink / raw)
  To: Matthias Brugger, AngeloGioacchino Del Regno, phucduc.bui
  Cc: linux-spi, linux-kernel, linux-arm-kernel, linux-mediatek

On Fri, 07 Aug 2026 17:29:30 +0700, phucduc.bui@gmail.com wrote:
> spi: mtk-nor: Propagate errors from optional IRQ lookup

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.3

Thanks!

[1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup
      https://git.kernel.org/broonie/spi/c/356d5869bc33
[2/2] spi: mtk-nor: Propagate errors from IRQ request
      https://git.kernel.org/broonie/spi/c/560fbcf4720b

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2026-08-13 11:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-07 10:29 [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup phucduc.bui
2026-08-07 10:29 ` [PATCH 2/2] spi: mtk-nor: Propagate errors from IRQ request phucduc.bui
2026-08-12 18:49 ` [PATCH 1/2] spi: mtk-nor: Propagate errors from optional IRQ lookup Mark Brown

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®