Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4024308rwb; Fri, 30 Sep 2022 11:36:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5UzIfMN0nHKZDsbk72DmN781NdLaRRM3qksyS9jrSrvq+FP9JyJ41M3dxBclt6y3IcfURo X-Received: by 2002:a17:907:7612:b0:771:db66:7b77 with SMTP id jx18-20020a170907761200b00771db667b77mr7355492ejc.228.1664562999094; Fri, 30 Sep 2022 11:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664562999; cv=none; d=google.com; s=arc-20160816; b=gaIIj/+k9ahu0Utmdf7ev26c16NnMwkhp78XaZSP+KjILXmIp5uZsbh3F5KTEYwnsZ uN68fmMIEoWrfmURSXaHFB99E8uujjqUZsgWtS5T2r7wg+jhNp5eXaAXnwlKsNMxz7+1 sAFrgxezkBYFLEZ/A0ht6CWHSKxW89Sus9YWLXD+mTiwqeEYWjcLEyNn0yRKZNWuKT9n /6jyHF8K20EhEqVOjnmVzmMVygwn/BSD5BBrvrgdtdr2ysgd5DUb6ViZW6Z3yzatx/N9 w1LiaR8HrLwYK9gtK54HAercwUEasYaHNzSvLRpdeRa0DZw+nF43nEovDetIXwJtA2Uu D53w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:thread-index:content-language :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=5Fh3K7lJoK9FD1ivV/YdzPkzD4ZRqWBv7CzkwG2ZuUI=; b=lmRhunHAx9eQQWN8oR9YEj9Wg2tPoDZ5cYMQN3SxC0/EM1BAUuQox105TYAoKeFZke l1b3LuOEAuAIFBHWE72vZe5Hw+Ghn2LkOkeHkDql3nIQkNUQVxuIE+qYHNDJKsHTBAJ0 l79R7g+nslkzpVARzH9EGqKwlCNhR36MyU6CTD630iQJQJ78vak1vx96EnBczdWJCbyh 0qDDuM0RlDk8WA5GolwIOfa2OvRo75rEdJFnLoSaXtw1pHg5shF59HF+/5ZJAzxT+ING JqSOydaydMDcsMcSYrR9D9CnZdJUdYdN2n8Qg212ceS5Jei3D87A5JsE+WmYai4uUGPx qd1g== 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 18-20020a170906301200b0078281504806si2121298ejz.162.2022.09.30.11.36.12; Fri, 30 Sep 2022 11:36:39 -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 S232027AbiI3SRL convert rfc822-to-8bit (ORCPT + 99 others); Fri, 30 Sep 2022 14:17:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231251AbiI3SRI (ORCPT ); Fri, 30 Sep 2022 14:17:08 -0400 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4CC2AC6971 for ; Fri, 30 Sep 2022 11:17:05 -0700 (PDT) X-QQ-mid: bizesmtpipv603t1664561732tz35 Received: from SJRobe ( [255.121.89.3]) by bizesmtp.qq.com (ESMTP) with id ; Sat, 01 Oct 2022 02:15:31 +0800 (CST) X-QQ-SSF: 01100000009000F0Z000B00A0000000 X-QQ-FEAT: KzokuMsy9J0pMqAkv2dvK58mQOF5DBYUygI6O9im+92owyXFDGj5W7JeSlGSA Oe/5VwiuAIvIAnJKKWuyxDXfwFvKi701H3ylfklFPoGtrlAy0x+rsMRgkb91/K1R33WdjqA SUk4xRJXlPzbfSVOWFqDeRzSvHZUxVpBm05LGVZgEocLkN0p0ySVEyE6m4MD3HK5+XoKleX SkJG4Y5treuH6vjpV1b6YexLKRFDvPrXw7NnNxHfzfFmZBRmmOXknA5ENJqYshVcDEn6I0N Q7pv5f0zz5B/YnCcU0U5uimeSl7zfCGAGKRAm0lW1nZa4Vl7hB+0rEoJ4ksDzxEqi7/3D9u 0PWwpuWZeZJ0mZ90Cc= X-QQ-GoodBg: 0 From: To: Cc: , , "'Wende Tan'" Subject: [PATCH] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq Date: Sat, 1 Oct 2022 02:15:29 +0800 Message-ID: <0E39B15006ADC205+02a601d8d4f8$a00a09e0$e01e1da0$@lohu.info> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT X-Mailer: Microsoft Outlook 16.0 Content-Language: fr Thread-Index: AdjU8Rq0bEYQpY6wRseuzIiSRju+zw== X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtpipv:lohu.info:qybglogicsvr:qybglogicsvr3 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,RCVD_ILLEGAL_IP, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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 From 02df97f4d814b9893eef2c2118b85d2b4b9d61ae Mon Sep 17 00:00:00 2001 From: Soha Jin Date: Sat, 1 Oct 2022 00:26:04 +0800 Subject: [PATCH] platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq 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. Signed-off-by: Soha Jin Tested-by: Wende Tan --- drivers/base/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 51bb22898..968f3d71e 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -441,8 +441,8 @@ 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 (!dev->dev.of_node || IS_ENABLED(CONFIG_OF_IRQ)) { + ret = fwnode_irq_get_byname(dev_fwnode(&dev->dev), name); if (ret > 0 || ret == -EPROBE_DEFER) return ret; } -- 2.30.2