diff options
Diffstat (limited to 'drivers/ide/pci/it8213.c')
-rw-r--r-- | drivers/ide/pci/it8213.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index 2a0f45c4f4c4..df74e588a530 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c | |||
@@ -28,7 +28,7 @@ | |||
28 | static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio) | 28 | static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio) |
29 | { | 29 | { |
30 | ide_hwif_t *hwif = HWIF(drive); | 30 | ide_hwif_t *hwif = HWIF(drive); |
31 | struct pci_dev *dev = hwif->pci_dev; | 31 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
32 | int is_slave = drive->dn & 1; | 32 | int is_slave = drive->dn & 1; |
33 | int master_port = 0x40; | 33 | int master_port = 0x40; |
34 | int slave_port = 0x44; | 34 | int slave_port = 0x44; |
@@ -85,7 +85,7 @@ static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
85 | static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) | 85 | static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) |
86 | { | 86 | { |
87 | ide_hwif_t *hwif = HWIF(drive); | 87 | ide_hwif_t *hwif = HWIF(drive); |
88 | struct pci_dev *dev = hwif->pci_dev; | 88 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
89 | u8 maslave = 0x40; | 89 | u8 maslave = 0x40; |
90 | int a_speed = 3 << (drive->dn * 4); | 90 | int a_speed = 3 << (drive->dn * 4); |
91 | int u_flag = 1 << drive->dn; | 91 | int u_flag = 1 << drive->dn; |
@@ -152,6 +152,7 @@ static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
152 | 152 | ||
153 | static void __devinit init_hwif_it8213(ide_hwif_t *hwif) | 153 | static void __devinit init_hwif_it8213(ide_hwif_t *hwif) |
154 | { | 154 | { |
155 | struct pci_dev *dev = to_pci_dev(hwif->dev); | ||
155 | u8 reg42h = 0; | 156 | u8 reg42h = 0; |
156 | 157 | ||
157 | hwif->set_dma_mode = &it8213_set_dma_mode; | 158 | hwif->set_dma_mode = &it8213_set_dma_mode; |
@@ -160,7 +161,7 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif) | |||
160 | if (!hwif->dma_base) | 161 | if (!hwif->dma_base) |
161 | return; | 162 | return; |
162 | 163 | ||
163 | pci_read_config_byte(hwif->pci_dev, 0x42, ®42h); | 164 | pci_read_config_byte(dev, 0x42, ®42h); |
164 | 165 | ||
165 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) | 166 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
166 | hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | 167 | hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; |