Message ID | 20230310144736.1546972-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 v21csp928308wrd; Fri, 10 Mar 2023 07:13:23 -0800 (PST) X-Google-Smtp-Source: AK7set/tkuqEjzsCd/7u31Ro+YkwGs0EucPDMgOiJ5PzEgRxbqHWxgIsfvk+GEVp64DPVo3GPCaR X-Received: by 2002:a17:90b:1d12:b0:234:e3f:f53b with SMTP id on18-20020a17090b1d1200b002340e3ff53bmr26490131pjb.21.1678461203039; Fri, 10 Mar 2023 07:13:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678461203; cv=none; d=google.com; s=arc-20160816; b=ESnAj5SZlk8rye3u+dsNMbYjCw/IyTStWdWsmuvfZhFyqwTe2vVveY2tg73S1ne5d5 hYJrZH0zWJ0aM4uAPS/tYPEg28cYyQ8r2whbizYWWjZQGsyqZrYqD8R+2RYxTxKWX7za fBprNpNGXD4l60hXJ25yRuErrTKObtIKcXSl6LOzyjTQimSaq3OcSgbxGjFy9YSaemjz Bqt6+D4wYSvWTnb06ALMHT/8REtXayiWbrSEXPpzdpJNWUp2YSUd+cLbU9AL/8sh0DSm AJmeHml0b8XqZ5gML0WwKuMdTtCb77YMTv35xvobrC7EE3LM7C96LR4wfKs5aTFyuEnQ K5JA== 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=JCpL7ocfi58njdErkPxcygUe6uPmxZK7sL4VjSYUEoA=; b=0u8G8j7ZkLpc9f2Z2zdXhYpv7TGZpPVrPb8jAZIjxi6RH6ExPc1uZXm3GJrEIVkuWs pPPlforGm+iR6qhswkfl9u87aTE1Yphh8tnN0XCt6sK1ZrnTfSiTuLllUgCSJg55TzZ1 OQUSD9PyPskOxXQFgPoDUSPrjGoySrYDVuGEz/kCYLAwmVcBe61KdzW90YQZweayklhw ytCKrAj83nlPSitt3xRQ7EQDYVk9x0BDmkr35vxw2yoGSMpCcyp+eettzXDLPW1csTAN E+7XBX55sjbQhi/mtOgUeNY1D84qpxr+WAEG0JA69CbNVoFv0zUsJQGeY4o/9YWmimeK pKig== 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 s11-20020a17090a760b00b0023720e7e54dsi103876pjk.49.2023.03.10.07.13.09; Fri, 10 Mar 2023 07:13:23 -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 S234051AbjCJPLt (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Fri, 10 Mar 2023 10:11:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbjCJPL0 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 10 Mar 2023 10:11:26 -0500 Received: from mail-yb1-xb2d.google.com (mail-yb1-xb2d.google.com [IPv6:2607:f8b0:4864:20::b2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C0865A1AD; Fri, 10 Mar 2023 07:03:28 -0800 (PST) Received: by mail-yb1-xb2d.google.com with SMTP id k199so5559748ybf.4; Fri, 10 Mar 2023 07:03:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678460486; 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=JCpL7ocfi58njdErkPxcygUe6uPmxZK7sL4VjSYUEoA=; b=CdxM2mokQ7mDhh2kVELL+O2mAZ7F7huAMb0UADDNSBNfwOzB0mKKQ3qI5G5fks15d4 rHYm3XJiGHarYlPXM5/djs0MFaLwsOYvge6IJgenm3L45d8+jYo3YrfGdax1mxZt/cSH EKCLIaDxYenFbSGl0zrCmdUiVo9hG5vBQYThlEOHVOBeSyCCCAwHSCAMbDQGNV1gOl4g 10BQnWMSO4RxOKb3IhdzSnxURbHoHR3A8Ah/k1my5ltnVyPiD/kOlDg/zOoRrF0PhMZj BGoST1E/47VuznV4XQ4mqE2PUo20FkBgC9NExwuVeIvfA0DOPqMsjjDRyEDNVL8/eVyi H7GQ== X-Gm-Message-State: AO0yUKWTdjRt0ROH93ajRGAffJP6JtgHMRIninu4m1U+gkFPaBhsW+IX VKSrqSURYsCqYGFnEbWPT03FifSc6A== X-Received: by 2002:a05:6870:4195:b0:16d:f177:1a1a with SMTP id y21-20020a056870419500b0016df1771a1amr16870566oac.46.1678459911484; Fri, 10 Mar 2023 06:51:51 -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 p12-20020a9d4e0c000000b00690df568258sm107688otf.63.2023.03.10.06.51.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Mar 2023 06:51:51 -0800 (PST) Received: (nullmailer pid 1546998 invoked by uid 1000); Fri, 10 Mar 2023 14:47:36 -0000 From: Rob Herring <robh@kernel.org> To: Patrice Chotard <patrice.chotard@foss.st.com>, Bjorn Andersson <andersson@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org> Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: st: Use of_property_present() for testing DT property presence Date: Fri, 10 Mar 2023 08:47:35 -0600 Message-Id: <20230310144736.1546972-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?1759994134608068197?= X-GMAIL-MSGID: =?utf-8?q?1759994134608068197?= |
Series |
remoteproc: st: 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/remoteproc/st_remoteproc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Fri, 10 Mar 2023 at 07:51, Rob Herring <robh@kernel.org> 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/remoteproc/st_remoteproc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c > index a3268d95a50e..50ef40671652 100644 > --- a/drivers/remoteproc/st_remoteproc.c > +++ b/drivers/remoteproc/st_remoteproc.c > @@ -379,7 +379,7 @@ static int st_rproc_probe(struct platform_device *pdev) > clk_set_rate(ddata->clk, ddata->clk_rate); > } > > - if (of_get_property(np, "mbox-names", NULL)) { > + if (of_property_present(np, "mbox-names")) { > ddata->mbox_client_vq0.dev = dev; > ddata->mbox_client_vq0.tx_done = NULL; > ddata->mbox_client_vq0.tx_block = false; Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org> > -- > 2.39.2 >
On Fri, Mar 10, 2023 at 08:47:35AM -0600, 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/remoteproc/st_remoteproc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Ping! > > diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c > index a3268d95a50e..50ef40671652 100644 > --- a/drivers/remoteproc/st_remoteproc.c > +++ b/drivers/remoteproc/st_remoteproc.c > @@ -379,7 +379,7 @@ static int st_rproc_probe(struct platform_device *pdev) > clk_set_rate(ddata->clk, ddata->clk_rate); > } > > - if (of_get_property(np, "mbox-names", NULL)) { > + if (of_property_present(np, "mbox-names")) { > ddata->mbox_client_vq0.dev = dev; > ddata->mbox_client_vq0.tx_done = NULL; > ddata->mbox_client_vq0.tx_block = false; > -- > 2.39.2 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Tue, 18 Apr 2023 at 10:26, Rob Herring <robh@kernel.org> wrote: > > On Fri, Mar 10, 2023 at 08:47:35AM -0600, 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/remoteproc/st_remoteproc.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Ping! I did provide an RB for this patch on the same day you sent it, thinking it was part of a larger refactoring effort. But taking another look now I see that it is not the case and will apply it right away. > > > > > diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c > > index a3268d95a50e..50ef40671652 100644 > > --- a/drivers/remoteproc/st_remoteproc.c > > +++ b/drivers/remoteproc/st_remoteproc.c > > @@ -379,7 +379,7 @@ static int st_rproc_probe(struct platform_device *pdev) > > clk_set_rate(ddata->clk, ddata->clk_rate); > > } > > > > - if (of_get_property(np, "mbox-names", NULL)) { > > + if (of_property_present(np, "mbox-names")) { > > ddata->mbox_client_vq0.dev = dev; > > ddata->mbox_client_vq0.tx_done = NULL; > > ddata->mbox_client_vq0.tx_block = false; > > -- > > 2.39.2 > > > > > > _______________________________________________ > > linux-arm-kernel mailing list > > linux-arm-kernel@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
On Fri, 10 Mar 2023 08:47:35 -0600, 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. > > [...] Applied, thanks! [1/1] remoteproc: st: Use of_property_present() for testing DT property presence commit: 1f6fa392a9942e4a2bd3122913baeb33e987ccd9 Best regards,
diff --git a/drivers/remoteproc/st_remoteproc.c b/drivers/remoteproc/st_remoteproc.c index a3268d95a50e..50ef40671652 100644 --- a/drivers/remoteproc/st_remoteproc.c +++ b/drivers/remoteproc/st_remoteproc.c @@ -379,7 +379,7 @@ static int st_rproc_probe(struct platform_device *pdev) clk_set_rate(ddata->clk, ddata->clk_rate); } - if (of_get_property(np, "mbox-names", NULL)) { + if (of_property_present(np, "mbox-names")) { ddata->mbox_client_vq0.dev = dev; ddata->mbox_client_vq0.tx_done = NULL; ddata->mbox_client_vq0.tx_block = false;