Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3466054pxb; Mon, 4 Apr 2022 17:52:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybdXY0AtCzdNXDahIdk319vxfM2spIPU8zEwoaCwHwWXHOUmXOJM9oTL0Yz2sS08qN0Ojq X-Received: by 2002:a17:90a:4890:b0:1bf:654e:e1a0 with SMTP id b16-20020a17090a489000b001bf654ee1a0mr1094760pjh.113.1649119971147; Mon, 04 Apr 2022 17:52:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649119971; cv=none; d=google.com; s=arc-20160816; b=up23dxWIvkMhFUboQpYB9lhLJbubp30eYIMZGhmdYgCMNv/VDhNRZxiNzS6fXFORoh 9Qroqt8j2fYqBm8HcCx5HimVjqBqNuxx/fM1NBSgw4dbO4thY35eYe91tHsRqgS5ieLv O1LH0aLVvth09aC2gW66122Zas6EtA0hZLz6KaJQXnYKqrzQmaMhUqTKClErz1NjmaQ3 3D3I84xMBgUvOCXMasCAv4DcIV3Zt+DahYD/qExfYhv/zPexzC/q/Eaxnp/+KGyd7vF9 X/70Gsi5ANHOWM2usPJSRUkrpZzN2fVJIuyk2+csUPghyExwSrOH6sB0zYgQnXnvtAhD yMDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=z3GmkdbKssirbKwqdkR0WBbxc/r/a/4DYQoLQ3yX6Wc=; b=diUls9k1Pv1xyF6BUYusuPawLfhLR3IYiWuL2mQzE/GkyHEveSZFChFzcycu6dbzG8 WbITKEqo8R+TTFGrkbTpvGqY34U2BhwC/EmCTnuUPKmzeG/MaxJnNvgdz0BSlnmEdxhj hIhn1a6xSHdZgjKATollUHqRR/dXn/RnXqGGryJNsIvWLCtvu5rZx1bifz1l/IACUB61 5vbEgKaR/EkQevitCcmbAKb864SOLjsA+O/PkgDKL2AYKucRx4r3EMJjwTo8VK1Qjkde N80IBSO0M4A119Zv3ezuW0nWIaW1+G4Tf/FMuvds8AxreeXdNvwyfNBHG4eIpvkDI6XD jA5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f13-20020a63de0d000000b003816043f0e5si10877727pgg.730.2022.04.04.17.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 17:52:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5D763FD6FA; Mon, 4 Apr 2022 17:01:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378757AbiDDP6U (ORCPT + 99 others); Mon, 4 Apr 2022 11:58:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351269AbiDDP6S (ORCPT ); Mon, 4 Apr 2022 11:58:18 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0067515A17; Mon, 4 Apr 2022 08:56:21 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.90,234,1643641200"; d="scan'208";a="116706764" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 05 Apr 2022 00:56:21 +0900 Received: from localhost.localdomain (unknown [10.226.36.204]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 81701400941E; Tue, 5 Apr 2022 00:56:19 +0900 (JST) From: Lad Prabhakar To: Sean Wang , Vinod Koul , Matthias Brugger , dmaengine@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, Prabhakar , Lad Prabhakar Subject: [PATCH v3 1/3] dmaengine: nbpfaxi: Use platform_get_irq_optional() to get the interrupt Date: Mon, 4 Apr 2022 16:55:55 +0100 Message-Id: <20220404155557.27316-2-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220404155557.27316-1-prabhakar.mahadev-lad.rj@bp.renesas.com> References: <20220404155557.27316-1-prabhakar.mahadev-lad.rj@bp.renesas.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). There are no non-DT users for this driver so interrupt range (irq_res->start-irq_res->end) is no longer required and with DT we will be sure it will be a single IRQ resource for each index. Signed-off-by: Lad Prabhakar Reviewed-by: Andy Shevchenko --- drivers/dma/nbpfaxi.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c index 9c52c57919c6..a7063e9cd551 100644 --- a/drivers/dma/nbpfaxi.c +++ b/drivers/dma/nbpfaxi.c @@ -1294,7 +1294,7 @@ static int nbpf_probe(struct platform_device *pdev) struct device_node *np = dev->of_node; struct nbpf_device *nbpf; struct dma_device *dma_dev; - struct resource *iomem, *irq_res; + struct resource *iomem; const struct nbpf_config *cfg; int num_channels; int ret, irq, eirq, i; @@ -1335,13 +1335,11 @@ static int nbpf_probe(struct platform_device *pdev) nbpf->config = cfg; for (i = 0; irqs < ARRAY_SIZE(irqbuf); i++) { - irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, i); - if (!irq_res) - break; - - for (irq = irq_res->start; irq <= irq_res->end; - irq++, irqs++) - irqbuf[irqs] = irq; + irq = platform_get_irq_optional(pdev, i); + if (irq < 0 && irq != -ENXIO) + return irq; + if (irq > 0) + irqbuf[irqs++] = irq; } /* -- 2.17.1