diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-13 11:47:51 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-13 11:47:51 -0400 |
commit | 3b4024d4297279ef85631f3c19a6fa4312b4c401 (patch) | |
tree | 7a48b1f88300dc8034e42cf36f1207da3c6ce911 /drivers | |
parent | 0f458943e0247906b7a3f534f9e9e7ff3d901296 (diff) |
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')
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 10 | ||||
-rw-r--r-- | drivers/ide/pci/via82cxxx.c | 10 |
2 files changed, 6 insertions, 14 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 @@ | |||
1 | /* | 1 | /* |
2 | * Version 2.22 | 2 | * Version 2.23 |
3 | * | 3 | * |
4 | * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04 | 4 | * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04 |
5 | * IDE driver for Linux. | 5 | * IDE driver for Linux. |
@@ -240,8 +240,8 @@ static int amd_set_drive(ide_drive_t *drive, const u8 speed) | |||
240 | struct ide_timing t, p; | 240 | struct ide_timing t, p; |
241 | int T, UT; | 241 | int T, UT; |
242 | 242 | ||
243 | if (speed != XFER_PIO_SLOW) | 243 | if (ide_config_drive_speed(drive, speed)) |
244 | ide_config_drive_speed(drive, speed); | 244 | return 1; |
245 | 245 | ||
246 | T = 1000000000 / amd_clock; | 246 | T = 1000000000 / amd_clock; |
247 | UT = (amd_config->udma_mask == ATA_UDMA2) ? T : (T / 2); | 247 | 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) | |||
258 | 258 | ||
259 | amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t); | 259 | amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t); |
260 | 260 | ||
261 | if (!drive->init_speed) | ||
262 | drive->init_speed = speed; | ||
263 | drive->current_speed = speed; | ||
264 | |||
265 | return 0; | 261 | return 0; |
266 | } | 262 | } |
267 | 263 | ||
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 378feb491ec4..ac094e51d2bf 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * Version 3.48 | 3 | * Version 3.49 |
4 | * | 4 | * |
5 | * VIA IDE driver for Linux. Supported southbridges: | 5 | * VIA IDE driver for Linux. Supported southbridges: |
6 | * | 6 | * |
@@ -165,8 +165,8 @@ static int via_set_drive(ide_drive_t *drive, const u8 speed) | |||
165 | struct ide_timing t, p; | 165 | struct ide_timing t, p; |
166 | unsigned int T, UT; | 166 | unsigned int T, UT; |
167 | 167 | ||
168 | if (speed != XFER_PIO_SLOW) | 168 | if (ide_config_drive_speed(drive, speed)) |
169 | ide_config_drive_speed(drive, speed); | 169 | return 1; |
170 | 170 | ||
171 | T = 1000000000 / via_clock; | 171 | T = 1000000000 / via_clock; |
172 | 172 | ||
@@ -187,10 +187,6 @@ static int via_set_drive(ide_drive_t *drive, const u8 speed) | |||
187 | 187 | ||
188 | via_set_speed(HWIF(drive), drive->dn, &t); | 188 | via_set_speed(HWIF(drive), drive->dn, &t); |
189 | 189 | ||
190 | if (!drive->init_speed) | ||
191 | drive->init_speed = speed; | ||
192 | drive->current_speed = speed; | ||
193 | |||
194 | return 0; | 190 | return 0; |
195 | } | 191 | } |
196 | 192 | ||