Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1900049rwb; Fri, 11 Nov 2022 02:00:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf4O1i9qEAGr2AFS8Ndq9LHxDWo52SLAlaUyNEBuV8NNNQjLJMYTb0krSd+0B+crNRB0Q1eP X-Received: by 2002:a63:110d:0:b0:458:607f:a814 with SMTP id g13-20020a63110d000000b00458607fa814mr1023488pgl.62.1668160805439; Fri, 11 Nov 2022 02:00:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668160805; cv=none; d=google.com; s=arc-20160816; b=ZpGp/tv2q67L8k6tsRUWq+nPCCuiWBuYSMtn++phWXFawSMy1iE0wleiAPhbRTkDjR UbFMy28mX5vyk4y3x5dIciafPRnW8T/tsBgIWTwfHkpfepEd8UeC3x4f51zlGA4uqmYA dJerKr8a+NcqZ3XWkSNdmc24Y3gnxvlKSoyxjd9vnCPfXZD40DpcQ1GjmRFY/Sl7VZp5 VfDittmVhuZcFZQavbBGq1VwV0xnFiDGqTlVcbVavwv7liU7pddfUqrzHJN3P0FPlOvR 9J+l1pueJtJxQPy4T7VgMJ7J4LPE19qh5ByMEfB+GVmEJ/5+t/Rb9xqE/sAHhUIZASq3 BD8w== 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:dkim-signature; bh=QBuozeCGvJ1pPUnPmH4I3zOe7+Yzr9DI6CwqEv6b9JE=; b=KaKKjwlFQnKgQUlwZ5TYu6nG3kA6Z3rP+aVDNrZsYHlQH2FL+zob/s5e4aNel+fF/2 W/EZlCGLbG0hYbkPPTu7zyvU395ehO//Y1PH9x7I4DXGIezX3Ti7vL6uKmgLIIUt1bja gBEFwZeEcRUHvXbe2uRbVL/Mi0nTYmTTl+bFO2wza8qzgg1l8jnlr70UV23+eDBT0wfE PSs9P5OQvwqMp59BPF2MPFzOHWK/1dRESbZwLOqkUE4fqfSX1WIizGwh/HanNyrUGOPI OdJtgP7xNnEtqcIHPkII32c7Vq7NuDRboG2bk7Xlb+bYPY7NcP0t/uzN1x1uPLoGPmzr gxTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lohu.info header.s=biln2210 header.b=HkZ9gWWj; 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=lohu.info Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j6-20020a056a00234600b0056ca7c10cf2si2193083pfj.251.2022.11.11.01.59.53; Fri, 11 Nov 2022 02:00:05 -0800 (PST) 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=@lohu.info header.s=biln2210 header.b=HkZ9gWWj; 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=lohu.info Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233302AbiKKJqW (ORCPT + 92 others); Fri, 11 Nov 2022 04:46:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233360AbiKKJqP (ORCPT ); Fri, 11 Nov 2022 04:46:15 -0500 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29889CDC for ; Fri, 11 Nov 2022 01:46:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lohu.info; s=biln2210; t=1668159970; bh=QBuozeCGvJ1pPUnPmH4I3zOe7+Yzr9DI6CwqEv6b9JE=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=HkZ9gWWj2+ADpfcrJZgt/xND7H/ZvFse4wjmloWQUCQaSLVKrQEP6PZucWt2jgrfa gsM5f7/NRNnPQwdvBAmKSPl/3bb1fT0fqnDkUbd1+BcQv9EEB0YGCCFgvLX0GzopSe QKs/cz3yTPE90heD2s8Xo6VX1rkPeVuFy7PQYnA8= X-QQ-mid: bizesmtp70t1668159967tkdhay0e Received: from localhost.localdomain ( [223.166.236.91]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 11 Nov 2022 17:45:58 +0800 (CST) X-QQ-SSF: 01100000000000G0Z000000A0000000 X-QQ-FEAT: lP1Pu2Q8kTqcKFrUvbl6n7DNBaPweLpIzch4q+CEL724Fn8X3VErTTzPc7eqy rubbPz/70YVXV6jTL1pHxjbOZt+/etvhXdx6VbnZ/as7bRUtftD48fd+kAK2n75G8MDQLwK e7/++wIb6h04eyDWQow3NzHnFHADpqMM137xaGuBgYrQRibFanTEhEV1QA45+x/i/yprYfa v3k/sHO/6mqVyc8LQi+/JsyweIfAfpVDJtXizzJTpX82PqnFbWT9nB7Zoz4zLBHMYHs9q3e R/95L10xyDOVC8cE4OWUEpV+dCvNdYzfeDib3jf+nc/N8h0ZDu+G7s7WYjO77hSi0OZIJUR 7FRanaJEf/edEfBGwr7R/4DpRBn6nweixHCfygeAbypIK/MLws= X-QQ-GoodBg: 0 From: Soha Jin To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Soha Jin Subject: [PATCH driver-core-next] platform: remove useless if-branch in __platform_get_irq_byname() Date: Fri, 11 Nov 2022 17:45:42 +0800 Message-Id: <20221111094542.270540-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,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 When CONFIG_OF_IRQ is not enabled, there will be a stub method that always returns 0 when getting IRQ. Thus, the if-branch can be removed safely. Fixes: d4ad017d6345 ("platform: use fwnode_irq_get_byname instead of of_irq_get_byname to get irq") Signed-off-by: Soha Jin --- 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 968f3d71eeab..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 (!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; - } + 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