aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/cmd64x.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/cmd64x.c')
-rw-r--r--drivers/ide/cmd64x.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/ide/cmd64x.c b/drivers/ide/cmd64x.c
index fd904e923a9f..03c86209446f 100644
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -118,8 +118,9 @@ static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
118 ide_hwif_t *hwif = drive->hwif; 118 ide_hwif_t *hwif = drive->hwif;
119 struct pci_dev *dev = to_pci_dev(hwif->dev); 119 struct pci_dev *dev = to_pci_dev(hwif->dev);
120 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio); 120 struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
121 unsigned long setup_count;
121 unsigned int cycle_time; 122 unsigned int cycle_time;
122 u8 setup_count, arttim = 0; 123 u8 arttim = 0;
123 124
124 static const u8 setup_values[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0}; 125 static const u8 setup_values[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0};
125 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23}; 126 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23};
@@ -140,10 +141,11 @@ static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
140 if (hwif->channel) { 141 if (hwif->channel) {
141 ide_drive_t *pair = ide_get_pair_dev(drive); 142 ide_drive_t *pair = ide_get_pair_dev(drive);
142 143
143 drive->drive_data = setup_count; 144 ide_set_drivedata(drive, (void *)setup_count);
144 145
145 if (pair) 146 if (pair)
146 setup_count = max_t(u8, setup_count, pair->drive_data); 147 setup_count = max_t(u8, setup_count,
148 (unsigned long)ide_get_drivedata(pair));
147 } 149 }
148 150
149 if (setup_count > 5) /* shouldn't actually happen... */ 151 if (setup_count > 5) /* shouldn't actually happen... */