clocksource/drivers/ti: Use of_property_read_bool() for boolean properties
authorRob Herring <robh@kernel.org>
Fri, 10 Mar 2023 14:47:01 +0000 (08:47 -0600)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 24 Apr 2023 14:56:14 +0000 (16:56 +0200)
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>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20230310144702.1541660-1-robh@kernel.org
drivers/clocksource/timer-ti-dm-systimer.c
drivers/clocksource/timer-ti-dm.c

index 4fa68f6570566f3899398e7a876f1b44f3f807f7..c2dcd8d68e4587ac9e6d1de0e347e6bab0528ef9 100644 (file)
@@ -584,7 +584,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;
@@ -785,7 +785,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) {
index ab7a6caa36c5ee0e0ee1217396e142f5704c3573..1d3ad51e4634aef8d28d1736f890bd63a11ce709 100644 (file)
@@ -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;