From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Stultz Subject: [PATCH] ide: pdc202xxx_new: Remove do_gettimeofday() usage for ktime_get Date: Thu, 12 Mar 2015 10:23:52 -0700 Message-ID: <1426181032-2397-1-git-send-email-john.stultz@linaro.org> Return-path: Received: from mail-pd0-f175.google.com ([209.85.192.175]:45627 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754502AbbCLRX4 (ORCPT ); Thu, 12 Mar 2015 13:23:56 -0400 Received: by pdjy10 with SMTP id y10so21601066pdj.12 for ; Thu, 12 Mar 2015 10:23:56 -0700 (PDT) Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: lkml Cc: John Stultz , "David S. Miller" , Arnd Bergmann , linux-ide@vger.kernel.org As part of the y2038 cleanups, this patch removes the do_gettimeofday usage replacing it with ktime_get. Cc: "David S. Miller" Cc: Arnd Bergmann Cc: linux-ide@vger.kernel.org Signed-off-by: John Stultz --- drivers/ide/pdc202xx_new.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c index df73cbd..94bd05f 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -243,13 +244,13 @@ static long read_counter(u32 dma_base) */ static long detect_pll_input_clock(unsigned long dma_base) { - struct timeval start_time, end_time; + ktime_t start_time, end_time; long start_count, end_count; long pll_input, usec_elapsed; u8 scr1; start_count = read_counter(dma_base); - do_gettimeofday(&start_time); + start_time = ktime_get(); /* Start the test mode */ outb(0x01, dma_base + 0x01); @@ -261,7 +262,7 @@ static long detect_pll_input_clock(unsigned long dma_base) mdelay(10); end_count = read_counter(dma_base); - do_gettimeofday(&end_time); + end_time = ktime_get(); /* Stop the test mode */ outb(0x01, dma_base + 0x01); @@ -273,8 +274,7 @@ static long detect_pll_input_clock(unsigned long dma_base) * Calculate the input clock in Hz * (the clock counter is 30 bit wide and counts down) */ - usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + - (end_time.tv_usec - start_time.tv_usec); + usec_elapsed = (long)ktime_to_ns(ktime_sub(end_time, start_time))/1000; pll_input = ((start_count - end_count) & 0x3fffffff) / 10 * (10000000 / usec_elapsed); -- 1.9.1