[PATCH 2/5] gpio: aspeed-sgpio: propagate IRQ setup error in probe
From: shao.mingyin
Date: Sat Nov 07 2026 - 03:13:32 EST
From: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
aspeed_sgpio_probe() ignores the return value of
aspeed_sgpio_setup_irqs(). That function returns the result of
platform_get_irq(), so on failure - in particular -EPROBE_DEFER while
the parent interrupt controller is still probing - the driver carries on
and registers the gpiochip with no interrupt support, and the deferred
probe is never retried, leaving GPIO interrupts permanently broken.
The "interrupts" property is mandatory for this device, so propagate the
error from probe.
Fixes: 7db47faae79b ("gpio: aspeed: Add SGPIO driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Shao Mingyin <shao.mingyin@xxxxxxxxxx>
---
drivers/gpio/gpio-aspeed-sgpio.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-aspeed-sgpio.c b/drivers/gpio/gpio-aspeed-sgpio.c
index 4225261f61..9df0082270 100644
--- a/drivers/gpio/gpio-aspeed-sgpio.c
+++ b/drivers/gpio/gpio-aspeed-sgpio.c
@@ -686,7 +686,9 @@
gpio->chip.label = dev_name(&pdev->dev);
gpio->chip.base = -1;
- aspeed_sgpio_setup_irqs(gpio, pdev);
+ rc = aspeed_sgpio_setup_irqs(gpio, pdev);
+ if (rc)
+ return rc;
rc = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
if (rc < 0)