aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/via82cxxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/via82cxxx.c')
-rw-r--r--drivers/ide/pci/via82cxxx.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 4b32c90f4896..37de25b16b34 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -121,8 +121,8 @@ struct via82cxxx_dev
121 121
122static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing) 122static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
123{ 123{
124 struct pci_dev *dev = hwif->pci_dev; 124 struct pci_dev *dev = to_pci_dev(hwif->dev);
125 struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); 125 struct via82cxxx_dev *vdev = pci_get_drvdata(dev);
126 u8 t; 126 u8 t;
127 127
128 if (~vdev->via_config->flags & VIA_BAD_AST) { 128 if (~vdev->via_config->flags & VIA_BAD_AST) {
@@ -159,8 +159,10 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
159 159
160static void via_set_drive(ide_drive_t *drive, const u8 speed) 160static void via_set_drive(ide_drive_t *drive, const u8 speed)
161{ 161{
162 ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1); 162 ide_hwif_t *hwif = drive->hwif;
163 struct via82cxxx_dev *vdev = pci_get_drvdata(drive->hwif->pci_dev); 163 ide_drive_t *peer = hwif->drives + (~drive->dn & 1);
164 struct pci_dev *dev = to_pci_dev(hwif->dev);
165 struct via82cxxx_dev *vdev = pci_get_drvdata(dev);
164 struct ide_timing t, p; 166 struct ide_timing t, p;
165 unsigned int T, UT; 167 unsigned int T, UT;
166 168
@@ -408,7 +410,7 @@ static int via_cable_override(struct pci_dev *pdev)
408 410
409static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) 411static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif)
410{ 412{
411 struct pci_dev *pdev = hwif->pci_dev; 413 struct pci_dev *pdev = to_pci_dev(hwif->dev);
412 struct via82cxxx_dev *vdev = pci_get_drvdata(pdev); 414 struct via82cxxx_dev *vdev = pci_get_drvdata(pdev);
413 415
414 if (via_cable_override(pdev)) 416 if (via_cable_override(pdev))