pinctrl: bcm2835: Accept fewer than expected IRQs

The downstream .dts files only request two GPIO IRQs. Truncate the
array of parent IRQs when irq_of_parse_and_map returns 0.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2020-02-25 17:38:20 +00:00
committed by popcornmix
parent 8db95d487c
commit 4db96de8de

View File

@@ -1169,8 +1169,13 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
* bank that was firing the IRQ and look up the per-group
* and bank data.
*/
for (i = 0; i < BCM2835_NUM_IRQS; i++)
for (i = 0; i < BCM2835_NUM_IRQS; i++) {
girq->parents[i] = irq_of_parse_and_map(np, i);
if (!girq->parents[i]) {
girq->num_parents = i;
break;
}
}
girq->default_type = IRQ_TYPE_NONE;
girq->handler = handle_level_irq;