With new interface timecounter_initialize we can initialize timecounter fields and underlying cyclecounter together. Update mlx5 timecounter init with this new function.
Signed-off-by: Sagar Arun Kamble <[email protected]> Cc: Richard Cochran <[email protected]> Cc: Saeed Mahameed <[email protected]> Cc: Matan Barak <[email protected]> Cc: Leon Romanovsky <[email protected]> Cc: Eugenia Emantayev <[email protected]> Cc: Eitan Rabin <[email protected]> Cc: Feras Daoud <[email protected]> Cc: Sagar Arun Kamble <[email protected]> Cc: Miroslav Lichvar <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] --- drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c index 8cb6838..071f78a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c @@ -458,6 +458,7 @@ void mlx5_init_clock(struct mlx5_core_dev *mdev) u64 ns; u64 frac = 0; u32 dev_freq; + u32 mult, shift; dev_freq = MLX5_CAP_GEN(mdev, device_frequency_khz); if (!dev_freq) { @@ -465,13 +466,16 @@ void mlx5_init_clock(struct mlx5_core_dev *mdev) return; } rwlock_init(&clock->lock); - cc->read = read_internal_timer; - cc->shift = MLX5_CYCLES_SHIFT; - cc->mult = clocksource_khz2mult(dev_freq, cc->shift); - clock->nominal_c_mult = cc->mult; - cc->mask = CLOCKSOURCE_MASK(41); - - timecounter_init(&clock->tc, ktime_to_ns(ktime_get_real())); + shift = MLX5_CYCLES_SHIFT; + mult = clocksource_khz2mult(dev_freq, shift); + clock->nominal_c_mult = mult; + + timecounter_initialize(&clock->tc, + read_internal_timer, + CLOCKSOURCE_MASK(41), + mult, + shift, + ktime_to_ns(ktime_get_real())); /* Calculate period in seconds to call the overflow watchdog - to make * sure counter is checked at least once every wrap around. -- 1.9.1

