clocksource/drivers/vf-pit: Encapsulate the initialization of the cycles_per_jiffy
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 4 Aug 2025 15:23:24 +0000 (17:23 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Tue, 23 Sep 2025 10:28:56 +0000 (12:28 +0200)
Move the cycles_per_jiffy initialization to the same place where the
other pit timer fields are initialized.

No functional changes intended.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20250804152344.1109310-7-daniel.lezcano@linaro.org
drivers/clocksource/timer-vf-pit.c

index 9f3b72b..a11e6a6 100644 (file)
@@ -155,6 +155,7 @@ static int __init pit_clockevent_init(struct pit_timer *pit, void __iomem *base,
         * the channels 0 and 1 unused for anyone else who needs them
         */
        pit->clkevt_base = base + PIT_CH(3);
+       pit->cycle_per_jiffy = rate / (HZ);
 
        writel(0, pit->clkevt_base + PITTCTRL);
 
@@ -212,7 +213,6 @@ static int __init pit_timer_init(struct device_node *np)
                return ret;
 
        clk_rate = clk_get_rate(pit_clk);
-       pit_timer.cycle_per_jiffy = clk_rate / (HZ);
 
        /* enable the pit module */
        writel(~PITMCR_MDIS, timer_base + PITMCR);