aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_old.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r--drivers/ide/pci/pdc202xx_old.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index ea66383c5579..df1c5fa44a7c 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -66,7 +66,7 @@ static void pdc_old_disable_66MHz_clock(ide_hwif_t *);
66static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed) 66static void pdc202xx_set_mode(ide_drive_t *drive, const u8 speed)
67{ 67{
68 ide_hwif_t *hwif = HWIF(drive); 68 ide_hwif_t *hwif = HWIF(drive);
69 struct pci_dev *dev = hwif->pci_dev; 69 struct pci_dev *dev = to_pci_dev(hwif->dev);
70 u8 drive_pci = 0x60 + (drive->dn << 2); 70 u8 drive_pci = 0x60 + (drive->dn << 2);
71 71
72 u8 AP = 0, BP = 0, CP = 0; 72 u8 AP = 0, BP = 0, CP = 0;
@@ -144,9 +144,10 @@ static void pdc202xx_set_pio_mode(ide_drive_t *drive, const u8 pio)
144 144
145static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) 145static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
146{ 146{
147 struct pci_dev *dev = to_pci_dev(hwif->dev);
147 u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10); 148 u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10);
148 149
149 pci_read_config_word(hwif->pci_dev, 0x50, &CIS); 150 pci_read_config_word(dev, 0x50, &CIS);
150 151
151 return (CIS & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; 152 return (CIS & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
152} 153}
@@ -305,12 +306,14 @@ static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev,
305 306
306static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) 307static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
307{ 308{
309 struct pci_dev *dev = to_pci_dev(hwif->dev);
310
308 hwif->set_pio_mode = &pdc202xx_set_pio_mode; 311 hwif->set_pio_mode = &pdc202xx_set_pio_mode;
309 hwif->set_dma_mode = &pdc202xx_set_mode; 312 hwif->set_dma_mode = &pdc202xx_set_mode;
310 313
311 hwif->quirkproc = &pdc202xx_quirkproc; 314 hwif->quirkproc = &pdc202xx_quirkproc;
312 315
313 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) 316 if (dev->device != PCI_DEVICE_ID_PROMISE_20246)
314 hwif->resetproc = &pdc202xx_reset; 317 hwif->resetproc = &pdc202xx_reset;
315 318
316 if (hwif->dma_base == 0) 319 if (hwif->dma_base == 0)
@@ -319,7 +322,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
319 hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; 322 hwif->dma_lost_irq = &pdc202xx_dma_lost_irq;
320 hwif->dma_timeout = &pdc202xx_dma_timeout; 323 hwif->dma_timeout = &pdc202xx_dma_timeout;
321 324
322 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { 325 if (dev->device != PCI_DEVICE_ID_PROMISE_20246) {
323 if (hwif->cbl != ATA_CBL_PATA40_SHORT) 326 if (hwif->cbl != ATA_CBL_PATA40_SHORT)
324 hwif->cbl = pdc202xx_old_cable_detect(hwif); 327 hwif->cbl = pdc202xx_old_cable_detect(hwif);
325 328