浏览代码

cmd64x: use ide_get_pair_dev() helper

There should be no functional changes caused by this patch.

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz 16 年之前
父节点
当前提交
5d44a1502f
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/ide/cmd64x.c

+ 4 - 2
drivers/ide/cmd64x.c

@@ -138,10 +138,12 @@ static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
 	 * the slowest address setup timing ourselves.
 	 * the slowest address setup timing ourselves.
 	 */
 	 */
 	if (hwif->channel) {
 	if (hwif->channel) {
-		ide_drive_t *drives = hwif->drives;
+		ide_drive_t *pair = ide_get_pair_dev(drive);
 
 
 		drive->drive_data = setup_count;
 		drive->drive_data = setup_count;
-		setup_count = max(drives[0].drive_data, drives[1].drive_data);
+
+		if (pair)
+			setup_count = max_t(u8, setup_count, pair->drive_data);
 	}
 	}
 
 
 	if (setup_count > 5)		/* shouldn't actually happen... */
 	if (setup_count > 5)		/* shouldn't actually happen... */