Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp2495706rdb; Fri, 18 Aug 2023 02:03:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg8thltE2IkvjIVrIVXwB5LE4lS6li1XF29kj/YY7m1wHt+AAgFXPcOOcULSOhjqqHa6io X-Received: by 2002:a05:6a20:1010:b0:133:bc8:e362 with SMTP id gs16-20020a056a20101000b001330bc8e362mr2085024pzc.24.1692349401321; Fri, 18 Aug 2023 02:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692349401; cv=none; d=google.com; s=arc-20160816; b=ecJ8GVqltT33uaIcvq+BjMm+WT2FqX5WR8F7TxdSP5rt0fOXQWfuFqcMeskELPVjIm oXVQDJhqyY+RnXiRlEyfNMfm6v0/dM8dgrpWhFhungUgc7c5Vd2J2/weKMEHpoLxGxLS Zh7fYTRoh8rIG6ab3Ve5ABGE3ssd7hd4pXWXo61mihrau/Wkdhcvg/PnBZK/Hh1B9AAP Gke+rgkI/H1AkJ3Y10Ja8HQtfQxhM9zl9nRoP5L8vAt0JTORb2f/Clcc9TCoBE1KxV/4 MPIQCur5amLJEkzRDPju0botTH53e9dLL9ECxqrDmnf7K0+CU7ok7tySqYV6rBqNkbZn jAtg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UKqID6rm8oCeIZir75saVvNtQQrbVyFJePhzr5Cquqk=; fh=UEVvRAFK6gmZxZNnJDUC7AmNk/iU78fiWA23OmiDi44=; b=v4whTxwwY7oJjGkqQ+0wWDFUstHnFcLnv9eEegxTJZZpm7YJsQdjv+AGYsWCQMxA1z blN/VleipwB5eECpdrICZcOVoFeFOVpVTQ87s5YMh6oR64rn4Qlv3fkflVNEBpOcQWOB +Ab+bZj5J+y8LZeohfD5tZmEwzsw/n9EAanQqWI0j5RKMBbWfrMqLYZiWMwXgWm7OMtF 9y8cvvXskVcjdP6asY3SsJV9SL4D69j1xPMSa/F7yTbJb21h7r+c7t9bE5y8JyJWJ0kS ORI9yy6bOPg3erK5AdhT0j6uCq5/jkZYdMFgb5PfN/ANPAWtuI5OE6XklZ50iW0zaqh0 bhTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cM9d+TDP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h18-20020a056a00231200b00686b62a6dc4si1199578pfh.145.2023.08.18.02.03.07; Fri, 18 Aug 2023 02:03:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cM9d+TDP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353953AbjHQRKa (ORCPT + 99 others); Thu, 17 Aug 2023 13:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353703AbjHQRJ5 (ORCPT ); Thu, 17 Aug 2023 13:09:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E768E2136; Thu, 17 Aug 2023 10:09:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 860F2675BF; Thu, 17 Aug 2023 17:09:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4803FC433CC; Thu, 17 Aug 2023 17:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692292196; bh=kv75d6y4CuM21MoxPELNwCryPzdrLaz2U6/TZ1c2g/I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cM9d+TDPiSlWrfjFOvVPKfKBgwVJRHE8gm7F8kCh8zBJgqDPcXkk3f37tY4HKgxPz 68jPWjxlFDQyx7dCM2uXRkTRWEXsH/Z101IbsMM51z6Dj6FrW4PWqXdXNeaEORLjGM nI39Z+t25Al5Jw//mTPh8k/HFx2vnFXBlm+mo5TTKmBzfzoyJ8u+SfRIOKfSrxMC35 tbMb3cNThT84kNq2HMUOkiuS61RV26Dtjs7mboLZj1p69LMYM3PoWzTJFjn/p6IV5m 2AhTvdBwvJXs4V4tSxa9iBtogYz5AvSXu6ZuVwHIXTBTc2yjuyUbtX94ehPPuKdkil X2iMrsh8hcGUA== From: Jisheng Zhang To: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next v5 7/9] net: stmmac: platform: support parsing safety irqs from DT Date: Fri, 18 Aug 2023 00:57:47 +0800 Message-Id: <20230817165749.672-8-jszhang@kernel.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230817165749.672-1-jszhang@kernel.org> References: <20230817165749.672-1-jszhang@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 The snps dwmac IP may support safety features, and those Safety Feature Correctible Error and Uncorrectible Error irqs may be separate irqs. Add support to parse the safety irqs from DT. Signed-off-by: Jisheng Zhang Acked-by: Alexandre TORGUE --- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index be8e79c7aa34..4a2002eea870 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -737,6 +737,18 @@ int stmmac_get_platform_resources(struct platform_device *pdev, dev_info(&pdev->dev, "IRQ eth_lpi not found\n"); } + stmmac_res->sfty_ce_irq = platform_get_irq_byname_optional(pdev, "sfty_ce"); + if (stmmac_res->sfty_ce_irq < 0) { + if (stmmac_res->sfty_ce_irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + } + + stmmac_res->sfty_ue_irq = platform_get_irq_byname_optional(pdev, "sfty_ue"); + if (stmmac_res->sfty_ue_irq < 0) { + if (stmmac_res->sfty_ue_irq == -EPROBE_DEFER) + return -EPROBE_DEFER; + } + stmmac_res->addr = devm_platform_ioremap_resource(pdev, 0); return PTR_ERR_OR_ZERO(stmmac_res->addr); -- 2.40.1