Skip to content

Commit 5d44a15

Browse files
committed
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>
1 parent 2b78ff5 commit 5d44a15

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/ide/cmd64x.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,12 @@ static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
138138
* the slowest address setup timing ourselves.
139139
*/
140140
if (hwif->channel) {
141-
ide_drive_t *drives = hwif->drives;
141+
ide_drive_t *pair = ide_get_pair_dev(drive);
142142

143143
drive->drive_data = setup_count;
144-
setup_count = max(drives[0].drive_data, drives[1].drive_data);
144+
145+
if (pair)
146+
setup_count = max_t(u8, setup_count, pair->drive_data);
145147
}
146148

147149
if (setup_count > 5) /* shouldn't actually happen... */

0 commit comments

Comments
 (0)