Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: mlxbf2: use platform_get_irq_optional()

The gpio-mlxbf2 driver interfaces with four GPIO controllers,
device instances 0-3. There are two IRQ resources shared between
the four controllers, and they are found in the ACPI table for
instances 0 and 3. The driver should not use platform_get_irq(),
otherwise this error is logged when probing instances 1 and 2:
mlxbf2_gpio MLNXBF22:01: error -ENXIO: IRQ index 0 not found

Fixes: 2b725265cb08 ("gpio: mlxbf2: Introduce IRQ support")
Cc: stable@vger.kernel.org
Signed-off-by: David Thompson <davthompson@nvidia.com>
Reviewed-by: Shravan Kumar Ramani <shravankr@nvidia.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Link: https://lore.kernel.org/r/20250728144619.29894-1-davthompson@nvidia.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

David Thompson and committed by
Bartosz Golaszewski
63c7bc53 b644c640

+1 -1
+1 -1
drivers/gpio/gpio-mlxbf2.c
··· 397 397 gc->ngpio = npins; 398 398 gc->owner = THIS_MODULE; 399 399 400 - irq = platform_get_irq(pdev, 0); 400 + irq = platform_get_irq_optional(pdev, 0); 401 401 if (irq >= 0) { 402 402 girq = &gs->gc.irq; 403 403 gpio_irq_chip_set_chip(girq, &mlxbf2_gpio_irq_chip);