aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-lib.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-11 17:53:59 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-11 17:53:59 -0400
commitf212ff28f08e4ddcef9f25b13463c45cc4204a0c (patch)
treee8fe63044c2ebec404689cbd55d75497aa77da0a /drivers/ide/ide-lib.c
parent3160d5416f39da9d9221fec7cb9d64399b706bbc (diff)
ide: move ide_rate_filter() calls to the upper layer (take 2)
* Move ide_rate_filter() calls from host drivers to IDE core. * Make ide_rate_filter() static. * Make 'speed' argument of ->speedproc const. v2: * Fix it8213_tune_chipset() comment. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r--drivers/ide/ide-lib.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 41a128f52112..957618849540 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -79,7 +79,7 @@ EXPORT_SYMBOL(ide_xfer_verbose);
79 * TODO: check device PIO capabilities 79 * TODO: check device PIO capabilities
80 */ 80 */
81 81
82u8 ide_rate_filter(ide_drive_t *drive, u8 speed) 82static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
83{ 83{
84 ide_hwif_t *hwif = drive->hwif; 84 ide_hwif_t *hwif = drive->hwif;
85 u8 mode = ide_find_dma_mode(drive, speed); 85 u8 mode = ide_find_dma_mode(drive, speed);
@@ -96,8 +96,6 @@ u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
96 return min(speed, mode); 96 return min(speed, mode);
97} 97}
98 98
99EXPORT_SYMBOL(ide_rate_filter);
100
101int ide_use_fast_pio(ide_drive_t *drive) 99int ide_use_fast_pio(ide_drive_t *drive)
102{ 100{
103 struct hd_driveid *id = drive->id; 101 struct hd_driveid *id = drive->id;
@@ -364,13 +362,14 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
364 362
365int ide_set_xfer_rate(ide_drive_t *drive, u8 rate) 363int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
366{ 364{
367#ifndef CONFIG_BLK_DEV_IDEDMA 365 ide_hwif_t *hwif = drive->hwif;
368 rate = min(rate, (u8) XFER_PIO_4); 366
369#endif 367 if (hwif->speedproc == NULL)
370 if(HWIF(drive)->speedproc)
371 return HWIF(drive)->speedproc(drive, rate);
372 else
373 return -1; 368 return -1;
369
370 rate = ide_rate_filter(drive, rate);
371
372 return hwif->speedproc(drive, rate);
374} 373}
375 374
376static void ide_dump_opcode(ide_drive_t *drive) 375static void ide_dump_opcode(ide_drive_t *drive)