[PATCH v1 2/2] gpio: mlxbf3: use platform_get_irq_optional()

David Thompson posted 2 patches 1 month, 3 weeks ago
There is a newer version of this series
[PATCH v1 2/2] gpio: mlxbf3: use platform_get_irq_optional()
Posted by David Thompson 1 month, 3 weeks ago
The gpio-mlxbf3 driver interfaces with two GPIO controllers,
device instance 0 and 1. There is a single IRQ resource shared
between the two controllers, and it is found in the ACPI table for
device instance 0. The driver should not use platform_get_irq(),
otherwise this error is logged when probing instance 1:
    mlxbf3_gpio MLNXBF33:01: error -ENXIO: IRQ index 0 not found

Fixes: cd33f216d241 ("gpio: mlxbf3: Add gpio driver support")
Signed-off-by: David Thompson <davthompson@nvidia.com>
---
 drivers/gpio/gpio-mlxbf3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/gpio-mlxbf3.c b/drivers/gpio/gpio-mlxbf3.c
index 10ea71273c89..ed29b07d16c1 100644
--- a/drivers/gpio/gpio-mlxbf3.c
+++ b/drivers/gpio/gpio-mlxbf3.c
@@ -227,7 +227,7 @@ static int mlxbf3_gpio_probe(struct platform_device *pdev)
 	gc->owner = THIS_MODULE;
 	gc->add_pin_ranges = mlxbf3_gpio_add_pin_ranges;
 
-	irq = platform_get_irq(pdev, 0);
+	irq = platform_get_irq_optional(pdev, 0);
 	if (irq >= 0) {
 		girq = &gs->gc.irq;
 		gpio_irq_chip_set_chip(girq, &gpio_mlxbf3_irqchip);
-- 
2.43.2
Re: [PATCH v1 2/2] gpio: mlxbf3: use platform_get_irq_optional()
Posted by Andy Shevchenko 1 month, 3 weeks ago
On Mon, Aug 11, 2025 at 01:50:45PM -0400, David Thompson wrote:
> The gpio-mlxbf3 driver interfaces with two GPIO controllers,
> device instance 0 and 1. There is a single IRQ resource shared
> between the two controllers, and it is found in the ACPI table for
> device instance 0. The driver should not use platform_get_irq(),
> otherwise this error is logged when probing instance 1:
>     mlxbf3_gpio MLNXBF33:01: error -ENXIO: IRQ index 0 not found

Missed Cc to stable@.

-- 
With Best Regards,
Andy Shevchenko
Re: [PATCH v1 2/2] gpio: mlxbf3: use platform_get_irq_optional()
Posted by Bartosz Golaszewski 1 month, 3 weeks ago
On Mon, Aug 11, 2025 at 10:35 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> On Mon, Aug 11, 2025 at 01:50:45PM -0400, David Thompson wrote:
> > The gpio-mlxbf3 driver interfaces with two GPIO controllers,
> > device instance 0 and 1. There is a single IRQ resource shared
> > between the two controllers, and it is found in the ACPI table for
> > device instance 0. The driver should not use platform_get_irq(),
> > otherwise this error is logged when probing instance 1:
> >     mlxbf3_gpio MLNXBF33:01: error -ENXIO: IRQ index 0 not found
>
> Missed Cc to stable@.
>
> --
> With Best Regards,
> Andy Shevchenko
>
>

I added it when applying.

Bart