Messages in this thread Patch in this message | | | From | Sagar Arun Kamble <> | Subject | [PATCH 03/27] microblaze: Use timecounter_initialize interface | Date | Fri, 15 Dec 2017 13:08:18 +0530 |
| |
With new interface timecounter_initialize we can initialize timecounter fields and underlying cyclecounter together. Update xilinx_tc init with this new function.
Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Michal Simek <monstr@monstr.eu> Cc: Daniel Lezcano <daniel.lezcano@linaro.org> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Nicolai Stange <nicstange@gmail.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Rob Herring <robh@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org --- arch/microblaze/kernel/timer.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/microblaze/kernel/timer.c b/arch/microblaze/kernel/timer.c index b7f89e9..b32a896 100644 --- a/arch/microblaze/kernel/timer.c +++ b/arch/microblaze/kernel/timer.c @@ -204,20 +204,21 @@ static u64 xilinx_cc_read(const struct cyclecounter *cc) return xilinx_read(NULL); } -static struct timecounter xilinx_tc = { - .cc.read = xilinx_cc_read, - .cc.mask = CLOCKSOURCE_MASK(32), - .cc.mult = 0, - .cc.shift = 8, -}; +static struct timecounter xilinx_tc; static int __init init_xilinx_timecounter(void) { - struct cyclecounter *cc = &xilinx_tc.cc; + u32 mult = 0; + u32 shift = 8; - cc->mult = div_sc(timer_clock_freq, NSEC_PER_SEC, cc->shift); + mult = div_sc(timer_clock_freq, NSEC_PER_SEC, shift); - timecounter_init(&xilinx_tc, sched_clock()); + timecounter_initialize(&xilinx_tc, + xilinx_cc_read, + CLOCKSOURCE_MASK(32), + mult, + shift, + sched_clock()); return 0; } -- 1.9.1
| |