From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C65A8C433EF for ; Fri, 24 Dec 2021 15:05:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xo86QSLDFT1YH0ut0aLPevyA4aVTKRwzUaZsp7IDCSw=; b=E+lAoOcGpXLa8u n+5ROtc5ms7xRtHJ9c+T/M+GGDRwHcKaTIOPmnNci1/eeGi7YQFXMujoMKiuIpb5PkEjwaDtZQ4r9 o5JM+lA72oPR35U00GGhnq4VQQkrtPUz/6tcEHsl3giRBqJa1Eyp6DX38EKYBupGuZHsCPjB4VrvF S6TuQ/MV03UroedpZhnDiofiMSdnGMVHc0KCZNorzwXLg5JiJ8y/jEnOODOKWz5egmkof8wjX7iOo UfY5qs0PSp51I00nouFSkKcWHWOMhsjM36hT0EcuoUTr9mipvDkrj+SWYx4o9UlY8T2xsTRRwmQo6 y+IAGKJ0sa/f0VnQFPnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0m6b-00EGYR-Qs; Fri, 24 Dec 2021 15:03:37 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0m6X-00EGXL-Ag for linux-arm-kernel@lists.infradead.org; Fri, 24 Dec 2021 15:03:35 +0000 Received: (Authenticated sender: alexandre.belloni@bootlin.com) by relay8-d.mail.gandi.net (Postfix) with ESMTPSA id D4E361BF203; Fri, 24 Dec 2021 15:03:27 +0000 (UTC) Date: Fri, 24 Dec 2021 16:03:26 +0100 From: Alexandre Belloni To: Lad Prabhakar Subject: Re: [PATCH 2/2] pinctrl: at91-pio4: Use platform_get_irq_optional() to get the interrupt Message-ID: References: <20211224145748.18754-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20211224145748.18754-3-prabhakar.mahadev-lad.rj@bp.renesas.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211224145748.18754-3-prabhakar.mahadev-lad.rj@bp.renesas.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211224_070333_543457_609B56BC X-CRM114-Status: GOOD ( 21.48 ) 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: , Cc: Linus Walleij , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Ludovic Desroches , Rob Herring , Prabhakar , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24/12/2021 14:57:48+0000, Lad Prabhakar wrote: > platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static > allocation of IRQ resources in DT core code, this causes an issue > when using hierarchical interrupt domains using "interrupts" property > in the node as this bypasses the hierarchical setup and messes up the > irq chaining. > > In preparation for removal of static setup of IRQ resource from DT core > code use platform_get_irq_optional(). > > Signed-off-by: Lad Prabhakar > --- > drivers/pinctrl/pinctrl-at91-pio4.c | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c > index fafd1f55cba7..ebfb106be97d 100644 > --- a/drivers/pinctrl/pinctrl-at91-pio4.c > +++ b/drivers/pinctrl/pinctrl-at91-pio4.c > @@ -1045,7 +1045,6 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) > const char **group_names; > const struct of_device_id *match; > int i, ret; > - struct resource *res; > struct atmel_pioctrl *atmel_pioctrl; > const struct atmel_pioctrl_data *atmel_pioctrl_data; > > @@ -1164,16 +1163,15 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) > > /* There is one controller but each bank has its own irq line. */ > for (i = 0; i < atmel_pioctrl->nbanks; i++) { > - res = platform_get_resource(pdev, IORESOURCE_IRQ, i); > - if (!res) { > + ret = platform_get_irq_optional(pdev, i); I don't think the irq should be optional here. > + if (ret < 0) { > dev_err(dev, "missing irq resource for group %c\n", > 'A' + i); > - return -EINVAL; > + return ret; > } > - atmel_pioctrl->irqs[i] = res->start; > - irq_set_chained_handler_and_data(res->start, > - atmel_gpio_irq_handler, atmel_pioctrl); > - dev_dbg(dev, "bank %i: irq=%pr\n", i, res); > + atmel_pioctrl->irqs[i] = ret; > + irq_set_chained_handler_and_data(ret, atmel_gpio_irq_handler, atmel_pioctrl); > + dev_dbg(dev, "bank %i: irq=%d\n", i, ret); > } > > atmel_pioctrl->irq_domain = irq_domain_add_linear(dev->of_node, > -- > 2.17.1 > -- Alexandre Belloni, co-owner and COO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel