aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_new.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/pdc202xx_new.c')
-rw-r--r--drivers/ide/pci/pdc202xx_new.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index 89d2363a1ebd..bb29db03540e 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -149,6 +149,7 @@ static struct udma_timing {
149static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed) 149static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed)
150{ 150{
151 ide_hwif_t *hwif = HWIF(drive); 151 ide_hwif_t *hwif = HWIF(drive);
152 struct pci_dev *dev = to_pci_dev(hwif->dev);
152 u8 adj = (drive->dn & 1) ? 0x08 : 0x00; 153 u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
153 154
154 /* 155 /*
@@ -159,7 +160,7 @@ static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed)
159 * As we set up the PLL to output 133 MHz for UltraDMA/133 capable 160 * As we set up the PLL to output 133 MHz for UltraDMA/133 capable
160 * chips, we must override the default register settings... 161 * chips, we must override the default register settings...
161 */ 162 */
162 if (max_dma_rate(hwif->pci_dev) == 4) { 163 if (max_dma_rate(dev) == 4) {
163 u8 mode = speed & 0x07; 164 u8 mode = speed & 0x07;
164 165
165 if (speed >= XFER_UDMA_0) { 166 if (speed >= XFER_UDMA_0) {
@@ -186,9 +187,10 @@ static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed)
186static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio) 187static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio)
187{ 188{
188 ide_hwif_t *hwif = drive->hwif; 189 ide_hwif_t *hwif = drive->hwif;
190 struct pci_dev *dev = to_pci_dev(hwif->dev);
189 u8 adj = (drive->dn & 1) ? 0x08 : 0x00; 191 u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
190 192
191 if (max_dma_rate(hwif->pci_dev) == 4) { 193 if (max_dma_rate(dev) == 4) {
192 set_indexed_reg(hwif, 0x0c + adj, pio_timings[pio].reg0c); 194 set_indexed_reg(hwif, 0x0c + adj, pio_timings[pio].reg0c);
193 set_indexed_reg(hwif, 0x0d + adj, pio_timings[pio].reg0d); 195 set_indexed_reg(hwif, 0x0d + adj, pio_timings[pio].reg0d);
194 set_indexed_reg(hwif, 0x13 + adj, pio_timings[pio].reg13); 196 set_indexed_reg(hwif, 0x13 + adj, pio_timings[pio].reg13);