aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it8213.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:31 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-01 17:09:31 -0500
commit36501650ec45b1db308c3b51886044863be2d762 (patch)
tree74cf9d9f313e510f8424f9bac35da8d61cce9f7b /drivers/ide/pci/it8213.c
parentf6fb786d6dcdd7d730e4fba620b071796f487e1b (diff)
ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_t
Keep pointer to struct device instead of struct pci_dev in ide_hwif_t. While on it: * Use *dev->dma_mask instead of pci_dev->dma_mask in ide_toggle_bounce(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/it8213.c')
-rw-r--r--drivers/ide/pci/it8213.c7
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 @@
28static void it8213_set_pio_mode(ide_drive_t *drive, const u8 pio) 28static 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)
85static void it8213_set_dma_mode(ide_drive_t *drive, const u8 speed) 85static 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
153static void __devinit init_hwif_it8213(ide_hwif_t *hwif) 153static 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, &reg42h); 164 pci_read_config_byte(dev, 0x42, &reg42h);
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;