diff mbox series

[2/2] i2c: designware: use polling when IRQ resource is 0

Message ID 20261103085719.440-2-samuel.tirwa@web.de
State New
Headers show
Series [1/2] mfd: intel-lpss: fall back to polling when no usable IRQ | expand

Commit Message

Samuel Tirwa Nov. 3, 2026, 8:57 a.m. UTC
From: Fix Agent <fix@kernel.org>

When an Intel LPSS I2C controller has no usable interrupt (firmware
reports PCI INTx as not connected), intel-lpss passes 0 as the IRQ base,
which leaves the child device with an IRQ resource whose start is 0.
platform_get_irq_optional() then returns 0 instead of -ENXIO, so the
DesignWare driver never enabled ACCESS_POLLING and request_irq(0, ...)
failed.

Treat an IRQ number of 0 the same as 'no IRQ resource' and enable
polling mode.

Signed-off-by: Fix Agent <fix@kernel.org>
---
 drivers/i2c/busses/i2c-designware-platdrv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c
index ca63b74..035ec92 100644
--- a/drivers/i2c/busses/i2c-designware-platdrv.c
+++ b/drivers/i2c/busses/i2c-designware-platdrv.c
@@ -4,7 +4,7 @@  static int dw_i2c_plat_probe(struct platform_device *pdev)
 	int irq, ret;
 
 	irq = platform_get_irq_optional(pdev, 0);
-	if (irq == -ENXIO)
+	if (irq == -ENXIO || irq == 0)
 		flags |= ACCESS_POLLING;
 	else if (irq < 0)
 		return irq;