diff options
Diffstat (limited to 'drivers/ide/pci/amd74xx.c')
-rw-r--r-- | drivers/ide/pci/amd74xx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c index 2e8cbcaf3ef5..ebc16deffe16 100644 --- a/drivers/ide/pci/amd74xx.c +++ b/drivers/ide/pci/amd74xx.c | |||
@@ -86,6 +86,7 @@ static void amd_set_speed(struct pci_dev *dev, u8 dn, u8 udma_mask, | |||
86 | static void amd_set_drive(ide_drive_t *drive, const u8 speed) | 86 | static void amd_set_drive(ide_drive_t *drive, const u8 speed) |
87 | { | 87 | { |
88 | ide_hwif_t *hwif = drive->hwif; | 88 | ide_hwif_t *hwif = drive->hwif; |
89 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
89 | ide_drive_t *peer = hwif->drives + (~drive->dn & 1); | 90 | ide_drive_t *peer = hwif->drives + (~drive->dn & 1); |
90 | struct ide_timing t, p; | 91 | struct ide_timing t, p; |
91 | int T, UT; | 92 | int T, UT; |
@@ -104,7 +105,7 @@ static void amd_set_drive(ide_drive_t *drive, const u8 speed) | |||
104 | if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1; | 105 | if (speed == XFER_UDMA_5 && amd_clock <= 33333) t.udma = 1; |
105 | if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 15; | 106 | if (speed == XFER_UDMA_6 && amd_clock <= 33333) t.udma = 15; |
106 | 107 | ||
107 | amd_set_speed(hwif->pci_dev, drive->dn, udma_mask, &t); | 108 | amd_set_speed(dev, drive->dn, udma_mask, &t); |
108 | } | 109 | } |
109 | 110 | ||
110 | /* | 111 | /* |
@@ -202,8 +203,10 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, | |||
202 | 203 | ||
203 | static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) | 204 | static void __devinit init_hwif_amd74xx(ide_hwif_t *hwif) |
204 | { | 205 | { |
206 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
207 | |||
205 | if (hwif->irq == 0) /* 0 is bogus but will do for now */ | 208 | if (hwif->irq == 0) /* 0 is bogus but will do for now */ |
206 | hwif->irq = pci_get_legacy_ide_irq(hwif->pci_dev, hwif->channel); | 209 | hwif->irq = pci_get_legacy_ide_irq(dev, hwif->channel); |
207 | 210 | ||
208 | hwif->set_pio_mode = &amd_set_pio_mode; | 211 | hwif->set_pio_mode = &amd_set_pio_mode; |
209 | hwif->set_dma_mode = &amd_set_drive; | 212 | hwif->set_dma_mode = &amd_set_drive; |