Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4550f6e authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman
Browse files

staging: mt7621-gpio: avoid to set up irqs if not defined in dts



If there is no interrupt defined in the dts 'irq_of_parse_and_map'
returns 0 and we should't set up interrupts for each gpio chip in
that case.

Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bfb623c5
Loading
Loading
Loading
Loading
+22 −20
Original line number Diff line number Diff line
@@ -237,6 +237,7 @@ mediatek_gpio_bank_probe(struct platform_device *pdev, struct device_node *bank)
		return ret;
	}

	if (gpio->gpio_irq) {
		/*
		 * Manually request the irq here instead of passing a flow-handler
		 * to gpiochip_set_chained_irqchip, because the irq is shared.
@@ -260,6 +261,7 @@ mediatek_gpio_bank_probe(struct platform_device *pdev, struct device_node *bank)

		gpiochip_set_chained_irqchip(&rg->chip, &mediatek_gpio_irq_chip,
					     gpio->gpio_irq, NULL);
	}

	/* set polarity to low for all gpios */
	mtk_gpio_w32(rg, GPIO_REG_POL, 0);