@@ -555,6 +555,11 @@ static int arch_timer_starting_cpu(unsigned int cpu)
return 0;
}
+static u32 arch_timer_mem_get_cntfrq(void __iomem *cntbase)
+{
+ return readl_relaxed(cntbase + CNTFRQ);
+}
+
static void
arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np)
{
@@ -569,7 +574,7 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np)
if (!acpi_disabled ||
of_property_read_u32(np, "clock-frequency", &arch_timer_rate)) {
if (cntbase)
- arch_timer_rate = readl_relaxed(cntbase + CNTFRQ);
+ arch_timer_rate = arch_timer_mem_get_cntfrq(cntbase);
else
arch_timer_rate = arch_timer_get_cntfrq();
}