From patchwork Thu Nov 17 07:30:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 21484 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp261113wrr; Wed, 16 Nov 2022 23:33:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5E1CHhGK40z97v4SnYgnj6KyAqfHtvsuJ8cnSEvaEBy4dyT0kKWiNhkdkfkuFMpAcVbxas X-Received: by 2002:a17:907:270e:b0:78d:3c82:a875 with SMTP id w14-20020a170907270e00b0078d3c82a875mr1136723ejk.465.1668670412185; Wed, 16 Nov 2022 23:33:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668670412; cv=none; d=google.com; s=arc-20160816; b=nzARV4Cm+HQMgfirfoDagA5rJ02hMsz65l/rwRxZja5Ootc+qCnDK/gIlJOWcBqWbk SP1aXdHvckqMvdAhl2q7Jw1iVE2i69AKWnOyW3R0Ci+2o0r4prvZJW3sLfcXfYDD7RAy c5QeJCUcE1iM8kxQIrHjJjLEyrIkoopUeL9FW/22EfF8MIAaEMgUxdbD7P446kwDMw8L heobAD/vSVsUfVTQSdkSVM1LrW5iAusiuFNEBB6gBE/b2VUGeACNEEJSPEM99mtoEGaC WoGjyXWJ8Z/Jr8qI6bgRh3jiNs4DWpkhlrYdbFfa4Ja7scEA2BGrFgZCLufRzX2SMBDJ +tog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=c3JbcHSjPV1gltg7eU3qeLsq1mO21jt6gzl20VcYZMw=; b=DibAsMeFkp+yqqKeU3msqLB2YJnEM08mIQbkzMzFDSXUKRMiXTVW+/GEa14b0jROoM 5nahrDLA51XYAtg8Ko17xGqf6wyGd4/h2YA+AyXG7RSsl/CVc7imlnEENLsHdVwy6d7B hrOql2HV0wOU9HhtzGjTnMRqQj82Brrqe74Ql5CICZT2BeNoNaeOuTy174DhegnOzDVb O9dFrLDtW3u8zqa7fObhwdPIF+oi0rsRGpPp0Wb6OQTZDd3QgertqhxxSmhOmPA21v/i /fK6janZWNYIEDHYckSM4uORMSFUoJZaH66EZJDqe9xJNgonivLSIqixP4Rt1Vcpa/AH 28dQ== 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=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020a1709063ac200b00787aba35b7asi14053ejd.102.2022.11.16.23.33.09; Wed, 16 Nov 2022 23:33:32 -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; 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=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239337AbiKQHaM (ORCPT + 99 others); Thu, 17 Nov 2022 02:30:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239319AbiKQHaL (ORCPT ); Thu, 17 Nov 2022 02:30:11 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FAC729824 for ; Wed, 16 Nov 2022 23:30:10 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4NCWlh5S5Tz4y0vM; Thu, 17 Nov 2022 15:30:08 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AH7U1AM099425; Thu, 17 Nov 2022 15:30:01 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 17 Nov 2022 15:30:03 +0800 (CST) Date: Thu, 17 Nov 2022 15:30:03 +0800 (CST) X-Zmail-TransId: 2af96375e2fbffffffff94654c76 X-Mailer: Zmail v1.0 Message-ID: <202211171530030836446@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , Subject: =?utf-8?q?=5BPATCH_linux-next=5D_power=3A_supply=3A_core=3A_Use_dev?= =?utf-8?q?ice=5Fmatch=5Fof=5Fnode=28=29?= X-MAIL: mse-fl2.zte.com.cn 2AH7U1AM099425 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.251.13.novalocal with ID 6375E300.001 by FangMail milter! X-FangMail-Envelope: 1668670208/4NCWlh5S5Tz4y0vM/6375E300.001/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6375E300.001/4NCWlh5S5Tz4y0vM X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749727746166627969?= X-GMAIL-MSGID: =?utf-8?q?1749727746166627969?= From: ye xingchen Replace the open-code with device_match_of_node(). Signed-off-by: ye xingchen --- drivers/power/supply/power_supply_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 9035e349bf53..46d0cb0c5026 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -203,7 +203,7 @@ static int __power_supply_find_supply_from_node(struct device *dev, struct power_supply *epsy = dev_get_drvdata(dev); /* returning non-zero breaks out of class_for_each_device loop */ - if (epsy->of_node == np) + if (device_match_of_node(epsy, np)) return 1; return 0;