clocksource: ti: Use of_property_read_bool() for boolean properties
PATCH 1/1 clocksource: ti: Use of_property_read_bool() for boolean properties
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().
--- drivers/clocksource/timer-ti-dm-systimer.c | 4 ++-- drivers/clocksource/timer-ti-dm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/clocksource/timer-ti-dm-systimer.c +2 -2
@@ -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) {
drivers/clocksource/timer-ti-dm.c +4 -4
@@ -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;
Signature · 1 line
2.39.2
Quoted 10 lines · Rob Herring
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 <[email protected]>--- drivers/clocksource/timer-ti-dm-systimer.c | 4 ++-- drivers/clocksource/timer-ti-dm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
Ping!
Quoted 48 lines
drivers/clocksource/timer-ti-dm-systimer.c +2
-2@@ -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) {drivers/clocksource/timer-ti-dm.c +4
-4@@ -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;Signature · 1 line
2.39.2
Daniel Lezcano
AppliedQuoted 6 lines · Rob Herring
Quoted 5 lines · Rob Herring
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().
Quoted 7 lines
Quoted 5 lines
Signed-off-by Rob Herring <[email protected]>--- drivers/clocksource/timer-ti-dm-systimer.c | 4 ++-- drivers/clocksource/timer-ti-dm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)Ping!
Applied, thanks for heads up
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
[tip: timers/core] clocksource/drivers/ti: Use of_property_read_bool() for boolean properties
In reply to Rob HerringThe following commit has been merged into the timers/core branch of tip:
The following commit has been merged into the timers/core branch of tip:
Commit-ID: 87dd04f9b1a37a92ebbea5eb46e4941551d3547e Gitweb: https://git.kernel.org/tip/87dd04f9b1a37a92ebbea5eb46e4941551d3547e Author: Rob Herring <[email protected]> AuthorDate: Fri, 10 Mar 2023 08:47:01 -06:00 Committer: Daniel Lezcano <[email protected]> CommitterDate: Mon, 24 Apr 2023 16:56:14 +02:00
clocksource/drivers/ti: Use of_property_read_bool() for boolean properties
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().
--- drivers/clocksource/timer-ti-dm-systimer.c | 4 ++-- drivers/clocksource/timer-ti-dm.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/clocksource/timer-ti-dm-systimer.c +2 -2
@@ -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) {
drivers/clocksource/timer-ti-dm.c +4 -4
@@ -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;