summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-lib.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-12 01:53:59 +0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-12 01:53:59 +0400
commitf212ff28f08e4ddcef9f25b13463c45cc4204a0c (patch)
treee8fe63044c2ebec404689cbd55d75497aa77da0a /drivers/ide/ide-lib.c
parent3160d5416f39da9d9221fec7cb9d64399b706bbc (diff)
downloadlinux-f212ff28f08e4ddcef9f25b13463c45cc4204a0c.tar.xz
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);
* TODO: check device PIO capabilities
*/
-u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
+static u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
{
ide_hwif_t *hwif = drive->hwif;
u8 mode = ide_find_dma_mode(drive, speed);
@@ -96,8 +96,6 @@ u8 ide_rate_filter(ide_drive_t *drive, u8 speed)
return min(speed, mode);
}
-EXPORT_SYMBOL(ide_rate_filter);
-
int ide_use_fast_pio(ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
@@ -364,13 +362,14 @@ void ide_toggle_bounce(ide_drive_t *drive, int on)
int ide_set_xfer_rate(ide_drive_t *drive, u8 rate)
{
-#ifndef CONFIG_BLK_DEV_IDEDMA
- rate = min(rate, (u8) XFER_PIO_4);
-#endif
- if(HWIF(drive)->speedproc)
- return HWIF(drive)->speedproc(drive, rate);
- else
+ ide_hwif_t *hwif = drive->hwif;
+
+ if (hwif->speedproc == NULL)
return -1;
+
+ rate = ide_rate_filter(drive, rate);
+
+ return hwif->speedproc(drive, rate);
}
static void ide_dump_opcode(ide_drive_t *drive)