From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80D28C61DA4 for ; Mon, 13 Mar 2023 10:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0Gsl2Y9AkWjERx0lq2+gAIdruWcwOxWkFz81lJBK8OI=; b=4mD8lZd6c45p/f IlVQ4gVNCuLWJNjeQ3UpZTJePPSexx29GL1YfFub3VOApnCiDlrWZng17EPgI6/vUBadBEMF1rMFN +OZZkUN6snIR2nsH1hIH1EOvg/sOtPRrVzcwvK2zrddkcSJI7BmL/Maix1IS4thPCr9wUs5EkKQBC AJqpVCJVE7D9AEF7cfvoJJkG4pYLBT99Dccn5cFCfGksz0fG3kYA/CHeJyhJARbD6m0hpImxAc+WN nVjhH+RBu217ts7qNJJ34xYjbqusBeR9/jf0p6c052PMh8rowXHE3JIXJoAAKy8e7hQ5OM6o0lOLj hQn0qNV9Y7/Gv+QuHzgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbfNV-005ARQ-MS; Mon, 13 Mar 2023 10:26:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pbfKY-005AAD-Ll for linux-arm-kernel@lists.infradead.org; Mon, 13 Mar 2023 10:23:04 +0000 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230313_032302_805837_80977313 X-CRM114-Status: GOOD ( 19.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel