Message ID | 20230310144706.1542365-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 v21csp915005wrd; Fri, 10 Mar 2023 06:50:42 -0800 (PST) X-Google-Smtp-Source: AK7set+AXCYyjOaadgOEOI554g4IA8XegiRw8NGHfB/PVU2SSQjk3w26mX61GdCr4FdlBw3RidFz X-Received: by 2002:a17:90b:4d11:b0:23a:4875:6e07 with SMTP id mw17-20020a17090b4d1100b0023a48756e07mr25683581pjb.40.1678459841883; Fri, 10 Mar 2023 06:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678459841; cv=none; d=google.com; s=arc-20160816; b=i03Kw1qa1xsL9Eh/HcPCaRhYPvNXvJ3salZ88EbVaUXB/G6lU2Af16dA2+IYdtD7qL RRoBBwkPFfPXOXfVul/TDdr22M/faAWYee/ugnz0pebDwPP8fo74W5VHeKTfujMnO7Jx mxsL+x+9zgdq03/OnsiW8cqwcgfExZ15gWNxo68vNxnIM0Gdi0t5x588wL6dxtkTnyWc 7hVRq4Zx9hEx1lmAJp1GSuN5Vb5lBb4aWRteMAN5ugK100HNczVQJFDHXmkhDtQQIk+3 tvtyNAeGA1yYzA2FYJMkcsDx17+6FG86Q+jau9PN0z+buNKYGdWQZHZJIYpl+0fruIxV nnrg== 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=a2CxQVHwtr3wlNxH6MjBO8bDMbJbWt3MoMaK9ZWX5lU=; b=Vn4MqyH+ZWEvts5X9e5Y5o3EkL52VQYfkFAQUfUkAt0r5a0gJsmjnDwuEU0Wi+BvLz pfbEE+M9uUQsZvIbEdvBhMm/uGqpgx/MfTiND5bt1E5LyRJPwA2eZFxmWfeUGZhwg0oQ RYDT7Nv0Y/cx93Z19WKvu+OUh40ml7U6dnz9UaaTWjo6BYcflZH3oSxtqokfAdeiG7jK 8ktaWH9hYU5pFOJxIyVCuip0DjDvTTrenEpOu0jY/hUV2pBJYhVtm19SffcvXQxPPJ5S G7C4RzRMFwpiVk2WAb6+rmgc7vUxoh46QOKlsTfyxZemVBj9YSk7XKwaTzKi6UaxHL1R sQwA== 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 mu6-20020a17090b388600b00233af8acdc6si30818pjb.137.2023.03.10.06.50.26; Fri, 10 Mar 2023 06:50:41 -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 S233289AbjCJOtk (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 09:49:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232979AbjCJOsR (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 09:48:17 -0500 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF98122399; Fri, 10 Mar 2023 06:47:29 -0800 (PST) Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-176261d7f45so6034839fac.11; Fri, 10 Mar 2023 06:47:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678459649; 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=a2CxQVHwtr3wlNxH6MjBO8bDMbJbWt3MoMaK9ZWX5lU=; b=14M+FGldcMZanV11C51qabmOMPfHs6nNaCHFItnzOaxMBisgUYfmKPNrsmvaF54cMa 8t9dLMXCt7bKlNczbj2YS9VrImY33tyEZOr3B1ruRAwP3fkpphqqX2ghYAbp7daoAlhi KzIBwSA/wD1DZRla0SjhO9TaJVYIPVSr4i+pDV2ibXpPuOBei5Emg02SO/yCaGGRIZ3d xJYqtT101yT1OxMt/KRGbnL/7tHGXQm5PuILjmP9hkMyqAgdxF6JLAimP3Vf8thJpiTZ R19xh/4i3uFjwSZ3iutWz9DEXab0fWT+4yA4MlQd0VVvPIds7hdBSBR0pNl8fyr1V02g 8w/g== X-Gm-Message-State: AO0yUKXI79MW1W8wC5rPAlbPXaikYVC+xkTkGrABNw/O5cmnf7LrBqKZ lj4Ib2yiv0vltCDZF/1dXRgZkCbL8w== X-Received: by 2002:a05:6870:3907:b0:172:3d66:c428 with SMTP id b7-20020a056870390700b001723d66c428mr16322716oap.25.1678459649240; Fri, 10 Mar 2023 06:47:29 -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 y13-20020a4ade0d000000b005251903c669sm666oot.13.2023.03.10.06.47.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:47:28 -0800 (PST) Received: (nullmailer pid 1542391 invoked by uid 1000); Fri, 10 Mar 2023 14:47:06 -0000 From: Rob Herring <robh@kernel.org> To: Dipen Patel <dipenp@nvidia.com> Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hte: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:06 -0600 Message-Id: <20230310144706.1542365-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.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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?1759992707016061982?= X-GMAIL-MSGID: =?utf-8?q?1759992707016061982?= |
Series |
hte: 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/hte/hte.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 3/10/23 6:47 AM, Rob Herring wrote: > 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/hte/hte.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Acked-by: Dipen Patel <dipenp@nvidia.com>
diff --git a/drivers/hte/hte.c b/drivers/hte/hte.c index 7c3b4476f890..9f3221462e75 100644 --- a/drivers/hte/hte.c +++ b/drivers/hte/hte.c @@ -518,7 +518,7 @@ static struct hte_device *hte_of_get_dev(struct device *dev, np = dev->of_node; - if (!of_find_property(np, "timestamp-names", NULL)) { + if (!of_property_present(np, "timestamp-names")) { /* Let hte core construct it during request time */ desc->attr.name = NULL; } else {