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

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
...@@ -237,6 +237,7 @@ mediatek_gpio_bank_probe(struct platform_device *pdev, struct device_node *bank) ...@@ -237,6 +237,7 @@ mediatek_gpio_bank_probe(struct platform_device *pdev, struct device_node *bank)
return ret; return ret;
} }
if (gpio->gpio_irq) {
/* /*
* Manually request the irq here instead of passing a flow-handler * Manually request the irq here instead of passing a flow-handler
* to gpiochip_set_chained_irqchip, because the irq is shared. * 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) ...@@ -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, gpiochip_set_chained_irqchip(&rg->chip, &mediatek_gpio_irq_chip,
gpio->gpio_irq, NULL); gpio->gpio_irq, NULL);
}
/* set polarity to low for all gpios */ /* set polarity to low for all gpios */
mtk_gpio_w32(rg, GPIO_REG_POL, 0); mtk_gpio_w32(rg, GPIO_REG_POL, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment