Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2740222rwi; Fri, 28 Oct 2022 10:35:21 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6pjFitTOpAJkxH2UXDmJO5sFVaqRuq1DaOfLqjadRzgvMMmvoZ2VmvYycvUVd7gYvx30BQ X-Received: by 2002:aa7:d744:0:b0:45c:e353:e891 with SMTP id a4-20020aa7d744000000b0045ce353e891mr572631eds.36.1666978521091; Fri, 28 Oct 2022 10:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666978521; cv=none; d=google.com; s=arc-20160816; b=QuIbs97TcxoyD01r/pi9Md2xc9pctS42PyGJuFTuyvsS8ThIXoo2i1/Z+L1vsyose1 vxkTm1QJRa3ts2YY1PDzaevy4ZvfuxBMTPOuq0OpKbgak7chh7oubsxf/YytqlCE9rnu zxu9ivOceZHRWD4mdR27WZ5iIQVe2BZ5w7wND5QgIiHeoClwRKPqBmfC6kL2AjKDToIA YWKuShCA0qzUxngn34qSWb45g69UdzCZuNQXr2ycyGbDurnb2B9vPfA6N1vg1KsJYI59 FfknxCZlzK5UwNt2Iud5iJo/gZC7z5D7meckYy0uFW8TvNCLHMJi6b2B+bqcxtB7hp6K t2Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=BNgRr9tT6hHdCCAlJrNRVKrdNKa1DKiFMsny6IBcdXg=; b=YS4IDKWUEiSK50PzLU1rpbhuTV7XahTrTlUVlqLHjUNXoi12CtxcPY2RQXDmjNY40C ZECfpprLejwhH7GlJK8JtuDT/CskjAvLpNcl5Mj6WibDW74BUtXXgIt/MioaAebxKrq5 vjIFiASMLbUZc0nLsAYqBf7h6fq2dTvzyc0nih5HFuBF1530iNKK7d0BdBwWuXgqmqn5 9K7FFqpYlCY5iClOOr1UIw3QcE/CchtXTlvEKUVjzt6+7ziPOP9honvh3vzSw4h0Hc3R /3JBbcH9DRqyb1L6+0rZ6irVHConm9UlrPMm6QCr2C5dwRf0/I0tpU+/S8JheXx4o2rw PDdA== 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=lohu.info Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020aa7d98b000000b00460f0c0c565si1583211eds.197.2022.10.28.10.34.54; Fri, 28 Oct 2022 10:35: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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=lohu.info Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJ1QnH (ORCPT + 99 others); Fri, 28 Oct 2022 12:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbiJ1QnF (ORCPT ); Fri, 28 Oct 2022 12:43:05 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EA351E3ECD for ; Fri, 28 Oct 2022 09:43:00 -0700 (PDT) X-QQ-mid: bizesmtp65t1666975373t3ojrg6p Received: from localhost.localdomain ( [139.227.214.232]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 29 Oct 2022 00:42:25 +0800 (CST) X-QQ-SSF: 01100000002000G0Z000B00A0000000 X-QQ-FEAT: HIVLo4mOhq4qihiPUl/eRaSVdgWUX71V7R5uJ06BDbmcypBb+mqsGkSrPIOFf sKrNbRzeGR6sCZ1H3OiUHjyt+wfn5os6fTIYkTsB8pe2tenL2s5BycrsMwOrBWv2Sc00ike dudrKmbBzDD9ngtWBXSrX9TfUwsISaJr2Nc1GRNoaaq0jUvajcgDRrpt30FBewM+WA+GDMI 6fHE8Uq6iqKKPyAeTo02wzRG8Kn8H/XSBu65Cpseho3ea17A7+ID7un6v/ml2/0CLbvuL0q dfEiplYMi8kIvgkrbRe2xqipb4XtqgBSWbr2DJm8zVYinnK2bOVqGo5AvqksVpFyy06DF+2 5lduiK4MFuxQZlV+Z4pTZ9qmrWvdQ== X-QQ-GoodBg: 0 From: Soha Jin To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Wende Tan , Soha Jin Subject: [PATCH v2] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq Date: Sat, 29 Oct 2022 00:41:20 +0800 Message-Id: <20221028164120.2798-1-soha@lohu.info> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:lohu.info:qybglogicsvr:qybglogicsvr3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Not only platform devices described by OF have named interrupts, but devices described by ACPI also have named interrupts. The fwnode is an abstraction to different standards, and using fwnode_irq_get_byname can support more devices. Moreover, when CONFIG_OF_IRQ is not enabled, there will be a stub method always returning 0, the if statement can be removed safely. Signed-off-by: Soha Jin Tested-by: Wende Tan --- drivers/base/platform.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 51bb2289865c..6cd7fd478c5f 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -441,11 +441,9 @@ static int __platform_get_irq_byname(struct platform_device *dev, struct resource *r; int ret; - if (IS_ENABLED(CONFIG_OF_IRQ) && dev->dev.of_node) { - ret = of_irq_get_byname(dev->dev.of_node, name); - if (ret > 0 || ret == -EPROBE_DEFER) - return ret; - } + ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name); + if (ret > 0 || ret == -EPROBE_DEFER) + return ret; r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); if (r) { -- 2.30.2