@@ -15269,15 +15269,6 @@ static u64 bnx2x_cyclecounter_read(const struct cyclecounter *cc)
return phc_cycles;
}
-static void bnx2x_init_cyclecounter(struct cyclecounter *cc)
-{
- memset(cc, 0, sizeof(*cc));
- cc->read = bnx2x_cyclecounter_read;
- cc->mask = CYCLECOUNTER_MASK(64);
- cc->shift = 0;
- cc->mult = 1;
-}
-
static int bnx2x_send_reset_timesync_ramrod(struct bnx2x *bp)
{
struct bnx2x_func_state_params func_params = {NULL};
@@ -15511,9 +15502,12 @@ void bnx2x_init_ptp(struct bnx2x *bp)
* unload / load (e.g. MTU change) while it is running.
*/
if (!bp->timecounter_init_done) {
- bnx2x_init_cyclecounter(&bp->timecounter.cc);
- timecounter_init(&bp->timecounter,
- ktime_to_ns(ktime_get_real()));
+ timecounter_initialize(&bp->timecounter,
+ bnx2x_cyclecounter_read,
+ CYCLECOUNTER_MASK(64),
+ 1,
+ 0,
+ ktime_to_ns(ktime_get_real()));
bp->timecounter_init_done = 1;
}
With new interface timecounter_initialize we can initialize timecounter fields and underlying cyclecounter together. Update bnx2x timecounter init with this new function. Signed-off-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> Cc: Richard Cochran <richardcochran@gmail.com> Cc: Ariel Elior <ariel.elior@cavium.com> Cc: everest-linux-l2@cavium.com Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)