diff mbox series

gpio: thunderx: Fix up irqdomain push

Message ID 20191216091623.7766-1-linus.walleij@linaro.org
State New
Headers show
Series gpio: thunderx: Fix up irqdomain push | expand

Commit Message

Linus Walleij Dec. 16, 2019, 9:16 a.m. UTC
After registering the hierarchical irqdomain, the thunderX
driver proceeds to push the domain on top of all IRQs on the
chip, however the third parameter to irq_domain_push_irq()
needs to be a fwspec for the IRQ since this is whate the
gpiolib .alloc() callback expects. Fix it up.

Fixes: a7fc89f9d5fc ("gpio: thunderx: Switch to GPIOLIB_IRQCHIP")
Cc: Xiaotao Yin <Xiaotao.Yin@windriver.com>
Reported-by: Xiaotao Yin <Xiaotao.Yin@windriver.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/gpio/gpio-thunderx.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

-- 
2.23.0
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c
index d08d86a22b1f..e885a6d08a25 100644
--- a/drivers/gpio/gpio-thunderx.c
+++ b/drivers/gpio/gpio-thunderx.c
@@ -524,9 +524,15 @@  static int thunderx_gpio_probe(struct pci_dev *pdev,
 
 	/* Push on irq_data and the domain for each line. */
 	for (i = 0; i < ngpio; i++) {
-		err = irq_domain_push_irq(chip->irq.domain,
+		struct irq_fwspec fwspec;
+
+		fwspec.fwnode = of_node_to_fwnode(dev->of_node);
+		fwspec.param_count = 2;
+		fwspec.param[0] = i;
+		fwspec.param[1] = IRQ_TYPE_NONE;
+		err = irq_domain_push_irq(girq->domain,
 					  txgpio->msix_entries[i].vector,
-					  chip);
+					  &fwspec);
 		if (err < 0)
 			dev_err(dev, "irq_domain_push_irq: %d\n", err);
 	}