mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
gpio: mlxbf2: Handle errors from optional IRQ lookup
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> Link: https://patch.msgid.link/20260814043028.12548-3-phucduc.bui@gmail.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
This commit is contained in:
parent
53ffd779a0
commit
d8aaf6b0fd
|
|
@ -394,7 +394,9 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
|
|||
gc->owner = THIS_MODULE;
|
||||
|
||||
irq = platform_get_irq_optional(pdev, 0);
|
||||
if (irq >= 0) {
|
||||
if (irq < 0 && irq != -ENXIO)
|
||||
return irq;
|
||||
if (irq > 0) {
|
||||
girq = &gs->chip.gc.irq;
|
||||
gpio_irq_chip_set_chip(girq, &mlxbf2_gpio_irq_chip);
|
||||
girq->handler = handle_simple_irq;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user