ide: refactor tf_load() method
[deliverable/linux.git] / drivers / ide / ide-iops.c
index 0fdf0dfb57435c5cee683cb71fa3cd897d6c9197..6f1ed427a484405fbe8ca5aa849339ac59d6d963 100644 (file)
@@ -312,10 +312,10 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
 {
        ide_hwif_t *hwif = drive->hwif;
        const struct ide_tp_ops *tp_ops = hwif->tp_ops;
+       struct ide_taskfile tf;
        u16 *id = drive->id, i;
        int error = 0;
        u8 stat;
-       struct ide_cmd cmd;
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
        if (hwif->dma_ops)      /* check if host supports DMA */
@@ -347,12 +347,11 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
        udelay(1);
        tp_ops->write_devctl(hwif, ATA_NIEN | ATA_DEVCTL_OBS);
 
-       memset(&cmd, 0, sizeof(cmd));
-       cmd.valid.out.tf = IDE_VALID_FEATURE | IDE_VALID_NSECT;
-       cmd.tf.feature = SETFEATURES_XFER;
-       cmd.tf.nsect   = speed;
+       memset(&tf, 0, sizeof(tf));
+       tf.feature = SETFEATURES_XFER;
+       tf.nsect   = speed;
 
-       tp_ops->tf_load(drive, &cmd);
+       tp_ops->tf_load(drive, &tf, IDE_VALID_FEATURE | IDE_VALID_NSECT);
 
        tp_ops->exec_command(hwif, ATA_CMD_SET_FEATURES);
 
This page took 0.100007 seconds and 5 git commands to generate.