Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH 1/4] gpio: realtek-otto: Handle errors from optional IRQ lookup
@ 2026-08-14  4:30 phucduc.bui
  2026-08-14  4:30 ` [PATCH 2/4] gpio: mlxbf3: " phucduc.bui
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: phucduc.bui @ 2026-08-14  4:30 UTC (permalink / raw)
  To: Adrian Ng, Linus Walleij, Bartosz Golaszewski, linux-gpio,
	linux-kernel
  Cc: 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 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 <phucduc.bui@gmail.com>
---
 drivers/gpio/gpio-realtek-otto.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpio-realtek-otto.c b/drivers/gpio/gpio-realtek-otto.c
index 4a606bad5848..5d7d28a26544 100644
--- a/drivers/gpio/gpio-realtek-otto.c
+++ b/drivers/gpio/gpio-realtek-otto.c
@@ -423,6 +423,8 @@ static int realtek_gpio_probe(struct platform_device *pdev)
 	ctrl->chip.gc.owner = THIS_MODULE;
 
 	irq = platform_get_irq_optional(pdev, 0);
+	if (irq < 0 && irq != -ENXIO)
+		return irq;
 	if (!(dev_flags & GPIO_INTERRUPTS_DISABLED) && irq > 0) {
 		girq = &ctrl->chip.gc.irq;
 		gpio_irq_chip_set_chip(girq, &realtek_gpio_irq_chip);
-- 
2.43.0


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

end of thread, other threads:[~2026-08-14  4:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14  4:30 [PATCH 1/4] gpio: realtek-otto: Handle errors from optional IRQ lookup phucduc.bui
2026-08-14  4:30 ` [PATCH 2/4] gpio: mlxbf3: " phucduc.bui
2026-08-14  4:30 ` [PATCH 3/4] gpio: mlxbf2: " phucduc.bui
2026-08-14  4:30 ` [PATCH 4/4] gpio: altera: " phucduc.bui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox