[PATCH v13 5/5] clocksource: dw_apb_timer: Use reset array API to handle all resets
From: dongxuyang
Date: Fri Jul 24 2026 - 04:53:02 EST
From: Xuyang Dong <dongxuyang@xxxxxxxxxxxxxxxxxx>
timer_get_base_and_rate() only ever fetched a single, index-0 reset
control via of_reset_control_get(np, NULL), which does not consult
reset-names and always resolves to the first entry. With the binding
now allowing a second entry, a device tree that lists both lines would
leave the second entry permanently unasserted, since the driver never
touches it.
Replace it with devm_reset_control_array_get_optional_exclusive() to
fetch and control all reset lines listed in the device tree, ensuring
every line is properly asserted and deasserted rather than only the first.
Signed-off-by: Xuyang Dong <dongxuyang@xxxxxxxxxxxxxxxxxx>
---
drivers/clocksource/dw_apb_timer_of.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/dw_apb_timer_of.c b/drivers/clocksource/dw_apb_timer_of.c
index 3245eb0c602d..ffe495a8416a 100644
--- a/drivers/clocksource/dw_apb_timer_of.c
+++ b/drivers/clocksource/dw_apb_timer_of.c
@@ -29,9 +29,11 @@ static int __init timer_get_base_and_rate(struct device_node *np,
/*
* Reset the timer if the reset control is available, wiping
- * out the state the firmware may have left it
+ * out the state the firmware may have left it.
+ * Use array variant to handle multiple resets (e.g., timer
+ * and APB interface resets) if specified in the device tree.
*/
- rstc = of_reset_control_get(np, NULL);
+ rstc = of_reset_control_array_get_optional_exclusive(np);
if (!IS_ERR(rstc)) {
reset_control_assert(rstc);
reset_control_deassert(rstc);
--
2.34.1