aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-iops.c')
-rw-r--r--drivers/ide/ide-iops.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 27bb70ddd459..c19a221b1e18 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -37,14 +37,11 @@ void SELECT_MASK(ide_drive_t *drive, int mask)
37 37
38u8 ide_read_error(ide_drive_t *drive) 38u8 ide_read_error(ide_drive_t *drive)
39{ 39{
40 struct ide_cmd cmd; 40 struct ide_taskfile tf;
41 41
42 memset(&cmd, 0, sizeof(cmd)); 42 drive->hwif->tp_ops->tf_read(drive, &tf, IDE_VALID_ERROR);
43 cmd.tf_flags = IDE_TFLAG_IN_ERROR;
44 43
45 drive->hwif->tp_ops->tf_read(drive, &cmd); 44 return tf.error;
46
47 return cmd.tf.error;
48} 45}
49EXPORT_SYMBOL_GPL(ide_read_error); 46EXPORT_SYMBOL_GPL(ide_read_error);
50 47
@@ -312,10 +309,10 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
312{ 309{
313 ide_hwif_t *hwif = drive->hwif; 310 ide_hwif_t *hwif = drive->hwif;
314 const struct ide_tp_ops *tp_ops = hwif->tp_ops; 311 const struct ide_tp_ops *tp_ops = hwif->tp_ops;
312 struct ide_taskfile tf;
315 u16 *id = drive->id, i; 313 u16 *id = drive->id, i;
316 int error = 0; 314 int error = 0;
317 u8 stat; 315 u8 stat;
318 struct ide_cmd cmd;
319 316
320#ifdef CONFIG_BLK_DEV_IDEDMA 317#ifdef CONFIG_BLK_DEV_IDEDMA
321 if (hwif->dma_ops) /* check if host supports DMA */ 318 if (hwif->dma_ops) /* check if host supports DMA */
@@ -347,12 +344,11 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
347 udelay(1); 344 udelay(1);
348 tp_ops->write_devctl(hwif, ATA_NIEN | ATA_DEVCTL_OBS); 345 tp_ops->write_devctl(hwif, ATA_NIEN | ATA_DEVCTL_OBS);
349 346
350 memset(&cmd, 0, sizeof(cmd)); 347 memset(&tf, 0, sizeof(tf));
351 cmd.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT; 348 tf.feature = SETFEATURES_XFER;
352 cmd.tf.feature = SETFEATURES_XFER; 349 tf.nsect = speed;
353 cmd.tf.nsect = speed;
354 350
355 tp_ops->tf_load(drive, &cmd); 351 tp_ops->tf_load(drive, &tf, IDE_VALID_FEATURE | IDE_VALID_NSECT);
356 352
357 tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES); 353 tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES);
358 354