summaryrefslogtreecommitdiff
path: root/drivers/ide/pci/amd74xx.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-13 19:47:51 +0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-13 19:47:51 +0400
commit3b4024d4297279ef85631f3c19a6fa4312b4c401 (patch)
tree7a48b1f88300dc8034e42cf36f1207da3c6ce911 /drivers/ide/pci/amd74xx.c
parent0f458943e0247906b7a3f534f9e9e7ff3d901296 (diff)
downloadlinux-3b4024d4297279ef85631f3c19a6fa4312b4c401.tar.xz
amd74xx/via82cxxx: check ide_config_drive_speed() return value
* Check ide_config_drive_speed() return value. * While at also call ide_config_drive_speed() if the transfer mode is XFER_PIO_SLOW (this case happens iff the transfer mode has already been set on the device by ide-proc.c::set_xfer_rate()) and remove redundant setting of ->{init,current}_speed. * Bump driver version. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/amd74xx.c')
-rw-r--r--drivers/ide/pci/amd74xx.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 513205e52ad2..71d2c670e97e 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -1,5 +1,5 @@
/*
- * Version 2.22
+ * Version 2.23
*
* AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
* IDE driver for Linux.
@@ -240,8 +240,8 @@ static int amd_set_drive(ide_drive_t *drive, const u8 speed)
struct ide_timing t, p;
int T, UT;
- if (speed != XFER_PIO_SLOW)
- ide_config_drive_speed(drive, speed);
+ if (ide_config_drive_speed(drive, speed))
+ return 1;
T = 1000000000 / amd_clock;
UT = (amd_config->udma_mask == ATA_UDMA2) ? T : (T / 2);
@@ -258,10 +258,6 @@ static int amd_set_drive(ide_drive_t *drive, const u8 speed)
amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
- if (!drive->init_speed)
- drive->init_speed = speed;
- drive->current_speed = speed;
-
return 0;
}