diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-01-20 14:01:31 -0300 |
commit | b4b7ff4b08e691656c9d77c758fc355833128ac0 (patch) | |
tree | 82fcb00e6b918026dc9f2d1f05ed8eee83874cc0 /drivers/ide/pdc202xx_new.c | |
parent | 35acfa0fc609f2a2cd95cef4a6a9c3a5c38f1778 (diff) |
Linux-libre 4.4-gnupck-4.4-gnu
Diffstat (limited to 'drivers/ide/pdc202xx_new.c')
-rw-r--r-- | drivers/ide/pdc202xx_new.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/ide/pdc202xx_new.c b/drivers/ide/pdc202xx_new.c index df73cbd93..9ad014a7a 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c @@ -22,6 +22,7 @@ #include <linux/pci.h> #include <linux/init.h> #include <linux/ide.h> +#include <linux/ktime.h> #include <asm/io.h> @@ -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 = ktime_us_delta(end_time, start_time); pll_input = ((start_count - end_count) & 0x3fffffff) / 10 * (10000000 / usec_elapsed); |