Thread (4 messages) flat view 4 messages, 1 author, 2026-08-13
COLD38d

[PATCH 2/3] i2c: brcmstb: Handle errors from optional IRQ lookup

From: <hidden>
Date: 2026-08-13 08:52:52
Also in: linux-i2c, lkml
Subsystem: broadcom brcmstb i2c driver, i2c subsystem, i2c subsystem host drivers, the rest · Maintainers: Kamal Dasu, Andi Shyti, Linus Torvalds

From: bui duc phuc <redacted>

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 optional IRQ is available. Other errors, such as -EPROBE_DEFER
and -EINVAL, should be propagated so that the caller can handle them
appropriately.

Propagate negative errors other than -ENXIO.

Signed-off-by: bui duc phuc <redacted>
---
 drivers/i2c/busses/i2c-brcmstb.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/i2c/busses/i2c-brcmstb.c b/drivers/i2c/busses/i2c-brcmstb.c
index 5fa30e8926c5..91525a36e575 100644
--- a/drivers/i2c/busses/i2c-brcmstb.c
+++ b/drivers/i2c/busses/i2c-brcmstb.c
@@ -648,6 +648,8 @@ static int brcmstb_i2c_probe(struct platform_device *pdev)
 
 	/* Get the interrupt number */
 	dev->irq = platform_get_irq_optional(pdev, 0);
+	if (dev->irq < 0 && dev->irq != -ENXIO)
+		return dev->irq;
 
 	/* disable the bsc interrupt line */
 	brcmstb_i2c_enable_disable_irq(dev, INT_DISABLE);
-- 
2.43.0

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help