Skip to contentSkip to conversation

clocksource/drivers/arm_arch_timer: Use of_property_present() for non-boolean properties

PATCH Applied Rob Herring (Arm) 2 participants 2 messages Nov 4, 2024 – Nov 13, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clocksource/drivers/arm_arch_timer: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

---
 drivers/clocksource/arm_arch_timer.c       | 2 +-
 drivers/clocksource/timer-ti-dm-systimer.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/clocksource/arm_arch_timer.c +1 -1
index 03733101e231..7bd099f728a9 100644
@@ -1430,7 +1430,7 @@ static int __init arch_timer_of_init(struct device_node *np)
 
 	arch_timers_present |= ARCH_TIMER_TYPE_CP15;
 
-	has_names = of_property_read_bool(np, "interrupt-names");
+	has_names = of_property_present(np, "interrupt-names");
 
 	for (i = ARCH_TIMER_PHYS_SECURE_PPI; i < ARCH_TIMER_MAX_TIMER_PPI; i++) {
 		if (has_names)
drivers/clocksource/timer-ti-dm-systimer.c +2 -2
index c2dcd8d68e45..c33c3b5e0e07 100644
@@ -202,10 +202,10 @@ static bool __init dmtimer_is_preferred(struct device_node *np)
 
 	/* Secure gptimer12 is always clocked with a fixed source */
 	if (!of_property_read_bool(np, "ti,timer-secure")) {
-		if (!of_property_read_bool(np, "assigned-clocks"))
+		if (!of_property_present(np, "assigned-clocks"))
 			return false;
 
-		if (!of_property_read_bool(np, "assigned-clock-parents"))
+		if (!of_property_present(np, "assigned-clock-parents"))
 			return false;
 	}
 
Signature · 1 line
2.45.2
#1 lore raw
The 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:     08b97fbd13de79744b31d2b3c8a0ab1a409b94fa
Gitweb:        https://git.kernel.org/tip/08b97fbd13de79744b31d2b3c8a0ab1a409b94fa
Author:        Rob Herring (Arm) <[email protected]>
AuthorDate:    Mon, 04 Nov 2024 13:05:06 -06:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Wed, 13 Nov 2024 13:49:33 +01:00

clocksource/drivers/arm_arch_timer: Use of_property_present() for non-boolean properties

The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence.

---
 drivers/clocksource/arm_arch_timer.c       | 2 +-
 drivers/clocksource/timer-ti-dm-systimer.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/clocksource/arm_arch_timer.c +1 -1
index 2bba81e..808f259 100644
@@ -1428,7 +1428,7 @@ static int __init arch_timer_of_init(struct device_node *np)
 
 	arch_timers_present |= ARCH_TIMER_TYPE_CP15;
 
-	has_names = of_property_read_bool(np, "interrupt-names");
+	has_names = of_property_present(np, "interrupt-names");
 
 	for (i = ARCH_TIMER_PHYS_SECURE_PPI; i < ARCH_TIMER_MAX_TIMER_PPI; i++) {
 		if (has_names)
drivers/clocksource/timer-ti-dm-systimer.c +2 -2
index d1c144d..985a6d0 100644
@@ -202,10 +202,10 @@ static bool __init dmtimer_is_preferred(struct device_node *np)
 
 	/* Secure gptimer12 is always clocked with a fixed source */
 	if (!of_property_read_bool(np, "ti,timer-secure")) {
-		if (!of_property_read_bool(np, "assigned-clocks"))
+		if (!of_property_present(np, "assigned-clocks"))
 			return false;
 
-		if (!of_property_read_bool(np, "assigned-clock-parents"))
+		if (!of_property_present(np, "assigned-clock-parents"))
 			return false;
 	}