From patchwork Fri May 21 09:01:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ivan T . Ivanov" X-Patchwork-Id: 12272455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1E72C433ED for ; Fri, 21 May 2021 09:04:15 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9FCB2613AC for ; Fri, 21 May 2021 09:04:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FCB2613AC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=9D4vWI8Q1MlLv/wTvMUA9ziWT0PEdeh8bpLffYpB9Lg=; b=Z5ptF0hLLsE/+uipVFyWHFO36T 9sR8AF7i0Z0Wa7NDMc8OQEKwnazw8Cn5x2fkxkTa9l+tlUKu3eFMxrdOIvr8xo2fGPopt3wj3jKXu rCYd0ddM5d6totaobqQzQY9w43xux1x0q8YVeAnCFxH+AJJnM0UB/o7dFSAl0rPBsj6yAYYRAJdtD g5njuceIk5aPZ9VibX2/kYxPyeG431OuFSW9gYfwtgKPIs3QN4SNMG0pR6UiqFju6hjLp2l4w6oE+ ybRiMSKy0VaFlPhNpyzRYLnSlwmGMyvKnBEd6uuCo7U75ZYs8xsNPl/KWwsmIypGirlHgg3MFn+fG TSlG/RJg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk12t-004axC-Er; Fri, 21 May 2021 09:02:15 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lk12p-004aut-RM; Fri, 21 May 2021 09:02:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:In-Reply-To:References; bh=mXOkfWzkwvkjeFq3ZcxTKpEgAjYEgfG3DJ92GKXbLRw=; b=JTm74QaxnsBtTJ4puEIV2m7Mqw lAVcAXBfU4Th9fLX2g/kfNEHFkCu238hC271cdxqY0mLeWpaJ7c1jAe+I1iTDQpj+bVShXIXJDqVQ TxSVCDDL2/1567ohbPzmnYbZrL32PFCDMigeErJOZL6gWQivpzxqjxpvP29VrrElWNc2EbvOCK6tE BvGtAdm+UXg+TxWOXcg4XXqygG31ttnNYh/rWz6dgY4yi3T6wPGEVx5Gij8bNW6+qiPC33CzeVocG YyxOFpJ4cCNI1R9GVb5PA7/kBeo8CSh0DYkYepldJ9FFs5eLx//JKrURy8FiVRJzx4g8vXe5W4F7C XGIwwXWA==; Received: from mx2.suse.de ([195.135.220.15]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lk12n-00Gy8O-8U; Fri, 21 May 2021 09:02:10 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210521_020209_489521_F43E4E04 X-CRM114-Status: GOOD ( 10.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Florian Fainelli --- 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);