Message ID | 20230310144734.1546656-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp946192wrd; Fri, 10 Mar 2023 07:48:54 -0800 (PST) X-Google-Smtp-Source: AK7set+joDxsXOBAKVDFe2B2iYaUzKd2m5eUu16yKZnaoEIrGVWdw2Jj8+WL5TdRbtWDJbv6Pzw9 X-Received: by 2002:a17:90b:1d8c:b0:229:649a:9a05 with SMTP id pf12-20020a17090b1d8c00b00229649a9a05mr27083043pjb.11.1678463334485; Fri, 10 Mar 2023 07:48:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678463334; cv=none; d=google.com; s=arc-20160816; b=DZbJJSAJsfJR5d1KOZanpGkE6JSUSzrHQCJ9ZaCzclCvdFvEB02Ntsxcl8X+EyB/jw GvdJRIB2KBE+MyiHMjAJNg+slH/mafn8u+Y8/GXEN+prWnbPhLuQPG+Ha70ZL+8Nn1ky L/sq9afgJ4gZ0YIalVP59Fm02HI9NMK7kicv36dLrgWNwDY/J0iw2/1utfj2WjjWEoJV MAuxP2a19115F+utq1kHzMjC+Cql8LuE15uQOc5jMnaMn1qUYeZNsuy6io87mgu+/NBI r5yLKQ0KWZzSyGPyso5wRS3JxoYKvFitwGZ5yunOrHm/DIxrNBgmboxz1qsLCGhYfnM5 fwLg== 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 :message-id:date:subject:cc:to:from; bh=q3KHc2qfQy8/Fx/GchcHCRrPSc3mgzu0I8uWgkcqEU0=; b=cv+d0SsgYwgAudiEq+3pmCuBaeUdSDa5Os4cstSKfwiSmJ6EuH8zL1kewukOcARbzE RdoEv6G0ZR+MhWHxCfiw6LgOqfQfFwLImHqwhSuzhqCLof1RoRERaADcbXjQALkC3kHa NC7hBX3xwataDbED4NmPNYp8tn14u5B5qOlw5rxwffqq7k+pxLCJW0BA9DiBKV+GayiW xlxH40Zst5g9/ODAA1j+exR9MMbqcqNcGcM7HmVuwR7z+985UQpUDl5QotNR9i2o0VY9 +27Rtgd/MCOJp+16553nYihKJBrCNrh+VwXnEPqH78rT0R3VlNOi8WzcgZuMgAOdSO4V PSyw== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a17090b079700b0023676a8e1b0si137644pjz.82.2023.03.10.07.48.38; Fri, 10 Mar 2023 07:48:54 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233561AbjCJO4h (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 09:56:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233734AbjCJOzL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 09:55:11 -0500 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAC3D12DDD3; Fri, 10 Mar 2023 06:50:38 -0800 (PST) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-1755e639b65so6083081fac.3; Fri, 10 Mar 2023 06:50:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459706; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=q3KHc2qfQy8/Fx/GchcHCRrPSc3mgzu0I8uWgkcqEU0=; b=YomaDBgKcI4/WOUBsKf74VZ64VP/0kiT0fkqBA4O1u2g3zDdn+3EAhyNVaqPgT2dRM asg7w43ASpptlSAW+581lRJ7skCKtB21FQhsjAnoHABHs0iHQnFU+weKPQ9d79BBSt38 UoyC4TW4KeQvCwXkpvKzgm5h5YV6/31b0wNHd2JUU8CTYn0Ikl9atR2SF/KV+3MBXLxh hf0MCMH5rxvuR7VangIXRblSXo+DnRM/jNAFd/VZ0Es75ZFzfuYonVW5AEPzr+pDYQ+c 8+LinPUQcIXevPKWRhlXDDWmQHAxuJE65ugP210eqyT+C2aeDgr2i7dziLg/1wiHWWuh yTzg== X-Gm-Message-State: AO0yUKVPaA2j8QimbJ5FQiPOBQo1MNCij7nQEORwdX6OsfHsEcF5KohT d5BQBN9QPkpoiIdzdQdNnmaTMKlk4Q== X-Received: by 2002:a05:6870:8a0e:b0:176:6b9f:7ff4 with SMTP id p14-20020a0568708a0e00b001766b9f7ff4mr13541205oaq.21.1678459706222; Fri, 10 Mar 2023 06:48:26 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id an10-20020a056871b18a00b001730afaeb63sm112238oac.19.2023.03.10.06.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:48:25 -0800 (PST) Received: (nullmailer pid 1546683 invoked by uid 1000); Fri, 10 Mar 2023 14:47:34 -0000 From: Rob Herring <robh@kernel.org> To: Tony Lindgren <tony@atomide.com> Cc: devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bus: ti-sysc: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:34 -0600 Message-Id: <20230310144734.1546656-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759996369507642280?= X-GMAIL-MSGID: =?utf-8?q?1759996369507642280?= |
Series |
bus: ti-sysc: Use of_property_present() for testing DT property presence
|
|
Commit Message
Rob Herring
March 10, 2023, 2:47 p.m. UTC
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties. As
part of this, convert of_get_property/of_find_property calls to the
recently added of_property_present() helper when we just want to test
for presence of a property and nothing more.
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/bus/ti-sysc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
* Rob Herring <robh@kernel.org> [230310 16:48]: > It is preferred to use typed property access functions (i.e. > of_property_read_<type> functions) rather than low-level > of_get_property/of_find_property functions for reading properties. As > part of this, convert of_get_property/of_find_property calls to the > recently added of_property_present() helper when we just want to test > for presence of a property and nothing more. Thanks applying into omap-for-v6.4/ti-sysc. Tony
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c index 6afae9897843..34d755797db4 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -964,7 +964,7 @@ static int sysc_map_and_check_registers(struct sysc *ddata) sysc_check_children(ddata); - if (!of_get_property(np, "reg", NULL)) + if (!of_property_present(np, "reg")) return 0; error = sysc_parse_registers(ddata);