diff options
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 df73cbd9387e..9ad014a7afc7 100644 --- a/drivers/ide/pdc202xx_new.c +++ b/drivers/ide/pdc202xx_new.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/pci.h> | 22 | #include <linux/pci.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | #include <linux/ide.h> | 24 | #include <linux/ide.h> |
25 | #include <linux/ktime.h> | ||
25 | 26 | ||
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
27 | 28 | ||
@@ -243,13 +244,13 @@ static long read_counter(u32 dma_base) | |||
243 | */ | 244 | */ |
244 | static long detect_pll_input_clock(unsigned long dma_base) | 245 | static long detect_pll_input_clock(unsigned long dma_base) |
245 | { | 246 | { |
246 | struct timeval start_time, end_time; | 247 | ktime_t start_time, end_time; |
247 | long start_count, end_count; | 248 | long start_count, end_count; |
248 | long pll_input, usec_elapsed; | 249 | long pll_input, usec_elapsed; |
249 | u8 scr1; | 250 | u8 scr1; |
250 | 251 | ||
251 | start_count = read_counter(dma_base); | 252 | start_count = read_counter(dma_base); |
252 | do_gettimeofday(&start_time); | 253 | start_time = ktime_get(); |
253 | 254 | ||
254 | /* Start the test mode */ | 255 | /* Start the test mode */ |
255 | outb(0x01, dma_base + 0x01); | 256 | outb(0x01, dma_base + 0x01); |
@@ -261,7 +262,7 @@ static long detect_pll_input_clock(unsigned long dma_base) | |||
261 | mdelay(10); | 262 | mdelay(10); |
262 | 263 | ||
263 | end_count = read_counter(dma_base); | 264 | end_count = read_counter(dma_base); |
264 | do_gettimeofday(&end_time); | 265 | end_time = ktime_get(); |
265 | 266 | ||
266 | /* Stop the test mode */ | 267 | /* Stop the test mode */ |
267 | outb(0x01, dma_base + 0x01); | 268 | outb(0x01, dma_base + 0x01); |
@@ -273,8 +274,7 @@ static long detect_pll_input_clock(unsigned long dma_base) | |||
273 | * Calculate the input clock in Hz | 274 | * Calculate the input clock in Hz |
274 | * (the clock counter is 30 bit wide and counts down) | 275 | * (the clock counter is 30 bit wide and counts down) |
275 | */ | 276 | */ |
276 | usec_elapsed = (end_time.tv_sec - start_time.tv_sec) * 1000000 + | 277 | usec_elapsed = ktime_us_delta(end_time, start_time); |
277 | (end_time.tv_usec - start_time.tv_usec); | ||
278 | pll_input = ((start_count - end_count) & 0x3fffffff) / 10 * | 278 | pll_input = ((start_count - end_count) & 0x3fffffff) / 10 * |
279 | (10000000 / usec_elapsed); | 279 | (10000000 / usec_elapsed); |
280 | 280 | ||