devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clocksource: ti: Use of_property_read_bool() for boolean properties
Date: Tue, 18 Apr 2023 11:24:37 -0500	[thread overview]
Message-ID: <20230418162437.GB1764573-robh@kernel.org> (raw)
In-Reply-To: <20230310144702.1541660-1-robh@kernel.org>

On Fri, Mar 10, 2023 at 08:47:01AM -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.
> Convert reading boolean properties to to of_property_read_bool().
> 
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  drivers/clocksource/timer-ti-dm-systimer.c | 4 ++--
>  drivers/clocksource/timer-ti-dm.c          | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)

Ping!

> 
> diff --git a/drivers/clocksource/timer-ti-dm-systimer.c b/drivers/clocksource/timer-ti-dm-systimer.c
> index 632523c1232f..efa5f55a65f8 100644
> --- a/drivers/clocksource/timer-ti-dm-systimer.c
> +++ b/drivers/clocksource/timer-ti-dm-systimer.c
> @@ -586,7 +586,7 @@ static int __init dmtimer_clkevt_init_common(struct dmtimer_clockevent *clkevt,
>  	writel_relaxed(OMAP_TIMER_INT_OVERFLOW, t->base + t->wakeup);
>  
>  	pr_info("TI gptimer %s: %s%lu Hz at %pOF\n",
> -		name, of_find_property(np, "ti,timer-alwon", NULL) ?
> +		name, of_property_read_bool(np, "ti,timer-alwon") ?
>  		"always-on " : "", t->rate, np->parent);
>  
>  	return 0;
> @@ -787,7 +787,7 @@ static int __init dmtimer_clocksource_init(struct device_node *np)
>  		       t->base + t->ctrl);
>  
>  	pr_info("TI gptimer clocksource: %s%pOF\n",
> -		of_find_property(np, "ti,timer-alwon", NULL) ?
> +		of_property_read_bool(np, "ti,timer-alwon") ?
>  		"always-on " : "", np->parent);
>  
>  	if (!dmtimer_sched_clock_counter) {
> diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c
> index b24b903a8822..7031aa1bfdcb 100644
> --- a/drivers/clocksource/timer-ti-dm.c
> +++ b/drivers/clocksource/timer-ti-dm.c
> @@ -1104,13 +1104,13 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
>  	platform_set_drvdata(pdev, timer);
>  
>  	if (dev->of_node) {
> -		if (of_find_property(dev->of_node, "ti,timer-alwon", NULL))
> +		if (of_property_read_bool(dev->of_node, "ti,timer-alwon"))
>  			timer->capability |= OMAP_TIMER_ALWON;
> -		if (of_find_property(dev->of_node, "ti,timer-dsp", NULL))
> +		if (of_property_read_bool(dev->of_node, "ti,timer-dsp"))
>  			timer->capability |= OMAP_TIMER_HAS_DSP_IRQ;
> -		if (of_find_property(dev->of_node, "ti,timer-pwm", NULL))
> +		if (of_property_read_bool(dev->of_node, "ti,timer-pwm"))
>  			timer->capability |= OMAP_TIMER_HAS_PWM;
> -		if (of_find_property(dev->of_node, "ti,timer-secure", NULL))
> +		if (of_property_read_bool(dev->of_node, "ti,timer-secure"))
>  			timer->capability |= OMAP_TIMER_SECURE;
>  	} else {
>  		timer->id = pdev->id;
> -- 
> 2.39.2
> 

  reply	other threads:[~2023-04-18 16:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 14:47 [PATCH] clocksource: ti: Use of_property_read_bool() for boolean properties Rob Herring
2023-04-18 16:24 ` Rob Herring [this message]
2023-04-19  7:43   ` Daniel Lezcano

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=20230418162437.GB1764573-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).