return 0;
}
-static void __init _mxc_timer_init(void __iomem *base, int irq,
+static void __init _mxc_timer_init(int irq,
struct clk *clk_per, struct clk *clk_ipg)
{
uint32_t tctl_val;
clk_prepare_enable(clk_per);
- timer_base = base;
-
/*
* Initialise to a known state (all timers off, and timing reset)
*/
struct clk *clk_per = clk_get_sys("imx-gpt.0", "per");
struct clk *clk_ipg = clk_get_sys("imx-gpt.0", "ipg");
- _mxc_timer_init(base, irq, clk_per, clk_ipg);
+ timer_base = base;
+
+ _mxc_timer_init(irq, clk_per, clk_ipg);
}
void __init mxc_timer_init_dt(struct device_node *np)
{
struct clk *clk_per, *clk_ipg;
- void __iomem *base;
int irq;
- base = of_iomap(np, 0);
- WARN_ON(!base);
+ timer_base = of_iomap(np, 0);
+ WARN_ON(!timer_base);
irq = irq_of_parse_and_map(np, 0);
clk_per = of_clk_get_by_name(np, "per");
clk_ipg = of_clk_get_by_name(np, "ipg");
- _mxc_timer_init(base, irq, clk_per, clk_ipg);
+ _mxc_timer_init(irq, clk_per, clk_ipg);
}