[PATCH] gpio: altera: Fix build failure caused by undeclared 'irq'

From: phucduc . bui

Date: Wed Sep 02 2026 - 23:09:40 EST


From: bui duc phuc <phucduc.bui@xxxxxxxxx>

Use 'mapped_irq' instead of the undefined 'irq' variable in
altera_gpio_probe().

The incorrect variable name causes the driver to fail to build with
an 'irq' undeclared error.

Fixes: 6e6e585b603e4 ("gpio: altera: Handle errors from optional IRQ lookup")
Reported-by: Mark Brown <broonie@xxxxxxxxxx>
Closes: https://lore.kernel.org/all/apgNYDiSiPmNZspF@xxxxxxxxxxxxx/
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
drivers/gpio/gpio-altera.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c
index d22f5be00745..a6ac9356229c 100644
--- a/drivers/gpio/gpio-altera.c
+++ b/drivers/gpio/gpio-altera.c
@@ -221,8 +221,8 @@ static int altera_gpio_probe(struct platform_device *pdev)

mapped_irq = platform_get_irq_optional(pdev, 0);
if (mapped_irq < 0) {
- if (irq != -ENXIO)
- return irq;
+ if (mapped_irq != -ENXIO)
+ return mapped_irq;
goto skip_irq;
}

--
2.43.0