Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1394606pxj; Fri, 21 May 2021 13:10:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9HQiSxZTx9q74WMW6tykSScl8iQ00yPT1QiEFXJslCdulV2uYXn14yL1gr5zaOXpzmLdm X-Received: by 2002:a92:d24d:: with SMTP id v13mr621289ilg.174.1621627815375; Fri, 21 May 2021 13:10:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627815; cv=none; d=google.com; s=arc-20160816; b=Bi9sDZKzQi7041YtuIe2AaDsJvsQZgNzEasElM8jFuJko4EEblYh1u/b0ds6ILdUdR YQmFVQBoyRsjAxtey/dary0Y7k9NZJpUQE01mH9QX51nwzXi2IU0r1gaytLqvQbcTXEH qdKKqF89dOvjdrnsOOCVWRgv6XBWOZ42zwx0TeepBc+vQNZ17fK0tP1PLiQngztZnbX5 O+TKkzsoiOWmJkKqhfthuUhct1VmQkO5eYUTuuIFy0s4EGYy1iykBOdNqY48rym89w+R IMZVqzDCWegKB30No2KnoyDeE3DIb4xpz+8t49rPc1HhvsKqzSfznzVWaBVg4etEquWF Q2+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mXOkfWzkwvkjeFq3ZcxTKpEgAjYEgfG3DJ92GKXbLRw=; b=lYUf0CMD13nFYFTJVRhgZ1+6g/5M65cvvbzGEeAePp7gqjsB/AHZwDRKvp9zJDMz8v bHcn+KFNOEl1bIE9go25FYffBik5bUSonEerVcoPTCTznMHVMkHsJcDfpmilvwufvnj9 gof76R7+GnBtrf3SEIuf6SrLLVQrbObtcwpaqPsCgQA5lDCgWpMnCYxljnbpRyeY1i00 HSxif2/9wPMcxhp0npVSCat5qbEOxNHU4rFCMaxkOsxaDGUIrkLJrKILpEj3hyRpPkvu IrtJYX8Mmw1Xtanspuq7CuZtAFKbPqQKrBnU/92JZchkN9EBFOIFYDzHgIrLbOocOA3B 9q7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e22si6351438iog.50.2021.05.21.13.10.02; Fri, 21 May 2021 13:10:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234555AbhEUJDa (ORCPT + 99 others); Fri, 21 May 2021 05:03:30 -0400 Received: from mx2.suse.de ([195.135.220.15]:46108 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234424AbhEUJD3 (ORCPT ); Fri, 21 May 2021 05:03:29 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 16978AAA6; Fri, 21 May 2021 09:02:06 +0000 (UTC) From: "Ivan T. Ivanov" To: Linus Walleij Cc: Phil Elwell , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, linux-gpio@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] pinctrl: bcm2835: Accept fewer than expected IRQs Date: Fri, 21 May 2021 12:01:58 +0300 Message-Id: <20210521090158.26932-1-iivanov@suse.de> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Phil Elwell 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 Signed-off-by: Ivan T. Ivanov --- drivers/pinctrl/bcm/pinctrl-bcm2835.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c index 1d21129f7751..2c87af1180c4 100644 --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c @@ -1274,9 +1274,13 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev) char *name; girq->parents[i] = irq_of_parse_and_map(np, i); - if (!is_7211) + if (!is_7211) { + if (!girq->parents[i]) { + girq->num_parents = i; + break; + } continue; - + } /* Skip over the all banks interrupts */ pc->wake_irq[i] = irq_of_parse_and_map(np, i + BCM2835_NUM_IRQS + 1); -- 2.31.1