Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD342C6FD19 for ; Mon, 13 Mar 2023 10:23:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229872AbjCMKXu (ORCPT ); Mon, 13 Mar 2023 06:23:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbjCMKXT (ORCPT ); Mon, 13 Mar 2023 06:23:19 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C0CD6C67A; Mon, 13 Mar 2023 03:23:01 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 12DE44B3; Mon, 13 Mar 2023 03:23:45 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB2553F71A; Mon, 13 Mar 2023 03:22:59 -0700 (PDT) Date: Mon, 13 Mar 2023 10:22:46 +0000 From: Andre Przywara To: Rob Herring Cc: Alessandro Zummo , Alexandre Belloni , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , devicetree@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: sun6i: Use of_property_present() for testing DT property presence Message-ID: <20230313102246.6a41d61e@slackpad.lan> In-Reply-To: <20230310144736.1547041-1-robh@kernel.org> References: <20230310144736.1547041-1-robh@kernel.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Mar 2023 08:47:36 -0600 Rob Herring wrote: > It is preferred to use typed property access functions (i.e. > of_property_read_ 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 Reviewed-by: Andre Przywara Cheers, Andre > --- > drivers/rtc/rtc-sun6i.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c > index 7038f47d77ff..dc76537f1b62 100644 > --- a/drivers/rtc/rtc-sun6i.c > +++ b/drivers/rtc/rtc-sun6i.c > @@ -260,7 +260,7 @@ static void __init sun6i_rtc_clk_init(struct device_node *node, > } > > /* Switch to the external, more precise, oscillator, if present */ > - if (of_get_property(node, "clocks", NULL)) { > + if (of_property_present(node, "clocks")) { > reg |= SUN6I_LOSC_CTRL_EXT_OSC; > if (rtc->data->has_losc_en) > reg |= SUN6I_LOSC_CTRL_EXT_LOSC_EN;