bcm27xx: add kernel 5.10 support
[openwrt/staging/noltari.git] / target / linux / bcm27xx / patches-5.10 / 950-0187-pinctrl-bcm2835-Accept-fewer-than-expected-IRQs.patch
1 From 9ab71458b5475c7d8d42896721e593f6ef1a5c7a Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Tue, 25 Feb 2020 17:38:20 +0000
4 Subject: [PATCH] pinctrl: bcm2835: Accept fewer than expected IRQs
5
6 The downstream .dts files only request two GPIO IRQs. Truncate the
7 array of parent IRQs when irq_of_parse_and_map returns 0.
8
9 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
10 ---
11 drivers/pinctrl/bcm/pinctrl-bcm2835.c | 8 ++++++--
12 1 file changed, 6 insertions(+), 2 deletions(-)
13
14 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
15 +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
16 @@ -1288,9 +1288,13 @@ static int bcm2835_pinctrl_probe(struct
17 char *name;
18
19 girq->parents[i] = irq_of_parse_and_map(np, i);
20 - if (!is_7211)
21 + if (!is_7211) {
22 + if (!girq->parents[i]) {
23 + girq->num_parents = i;
24 + break;
25 + }
26 continue;
27 -
28 + }
29 /* Skip over the all banks interrupts */
30 pc->wake_irq[i] = irq_of_parse_and_map(np, i +
31 BCM2835_NUM_IRQS + 1);