All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: Rob Herring <robh@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	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
Date: Mon, 13 Mar 2023 10:22:46 +0000	[thread overview]
Message-ID: <20230313102246.6a41d61e@slackpad.lan> (raw)
In-Reply-To: <20230310144736.1547041-1-robh@kernel.org>

On Fri, 10 Mar 2023 08:47:36 -0600
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>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

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;


WARNING: multiple messages have this Message-ID (diff)
From: Andre Przywara <andre.przywara@arm.com>
To: Rob Herring <robh@kernel.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	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
Date: Mon, 13 Mar 2023 10:22:46 +0000	[thread overview]
Message-ID: <20230313102246.6a41d61e@slackpad.lan> (raw)
In-Reply-To: <20230310144736.1547041-1-robh@kernel.org>

On Fri, 10 Mar 2023 08:47:36 -0600
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>

Reviewed-by: Andre Przywara <andre.przywara@arm.com>

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

  reply	other threads:[~2023-03-13 10:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:47 [PATCH] rtc: sun6i: Use of_property_present() for testing DT property presence Rob Herring
2023-03-10 14:47 ` Rob Herring
2023-03-13 10:22 ` Andre Przywara [this message]
2023-03-13 10:22   ` Andre Przywara
2023-03-14 19:58 ` Jernej Škrabec
2023-03-14 19:58   ` Jernej Škrabec
2023-03-17 22:21 ` Alexandre Belloni
2023-03-17 22:21   ` Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230313102246.6a41d61e@slackpad.lan \
    --to=andre.przywara@arm.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=robh@kernel.org \
    --cc=samuel@sholland.org \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.