aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cmd64x.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/cmd64x.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/cmd64x.c')
-rw-r--r--drivers/ide/pci/cmd64x.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index effd79a715b0..70265d5c59ba 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -71,7 +71,7 @@ static u8 quantize_timing(int timing, int quant)
71 */ 71 */
72static void program_cycle_times (ide_drive_t *drive, int cycle_time, int active_time) 72static void program_cycle_times (ide_drive_t *drive, int cycle_time, int active_time)
73{ 73{
74 struct pci_dev *dev = HWIF(drive)->pci_dev; 74 struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
75 int clock_time = 1000 / system_bus_clock(); 75 int clock_time = 1000 / system_bus_clock();
76 u8 cycle_count, active_count, recovery_count, drwtim; 76 u8 cycle_count, active_count, recovery_count, drwtim;
77 static const u8 recovery_values[] = 77 static const u8 recovery_values[] =
@@ -118,7 +118,7 @@ static void program_cycle_times (ide_drive_t *drive, int cycle_time, int active_
118static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio) 118static void cmd64x_tune_pio(ide_drive_t *drive, const u8 pio)
119{ 119{
120 ide_hwif_t *hwif = HWIF(drive); 120 ide_hwif_t *hwif = HWIF(drive);
121 struct pci_dev *dev = hwif->pci_dev; 121 struct pci_dev *dev = to_pci_dev(hwif->dev);
122 unsigned int cycle_time; 122 unsigned int cycle_time;
123 u8 setup_count, arttim = 0; 123 u8 setup_count, arttim = 0;
124 124
@@ -183,7 +183,7 @@ static void cmd64x_set_pio_mode(ide_drive_t *drive, const u8 pio)
183static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed) 183static void cmd64x_set_dma_mode(ide_drive_t *drive, const u8 speed)
184{ 184{
185 ide_hwif_t *hwif = HWIF(drive); 185 ide_hwif_t *hwif = HWIF(drive);
186 struct pci_dev *dev = hwif->pci_dev; 186 struct pci_dev *dev = to_pci_dev(hwif->dev);
187 u8 unit = drive->dn & 0x01; 187 u8 unit = drive->dn & 0x01;
188 u8 regU = 0, pciU = hwif->channel ? UDIDETCR1 : UDIDETCR0; 188 u8 regU = 0, pciU = hwif->channel ? UDIDETCR1 : UDIDETCR0;
189 189
@@ -245,7 +245,7 @@ static int cmd648_ide_dma_end (ide_drive_t *drive)
245static int cmd64x_ide_dma_end (ide_drive_t *drive) 245static int cmd64x_ide_dma_end (ide_drive_t *drive)
246{ 246{
247 ide_hwif_t *hwif = HWIF(drive); 247 ide_hwif_t *hwif = HWIF(drive);
248 struct pci_dev *dev = hwif->pci_dev; 248 struct pci_dev *dev = to_pci_dev(hwif->dev);
249 int irq_reg = hwif->channel ? ARTTIM23 : CFR; 249 int irq_reg = hwif->channel ? ARTTIM23 : CFR;
250 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 : 250 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 :
251 CFR_INTR_CH0; 251 CFR_INTR_CH0;
@@ -285,7 +285,7 @@ static int cmd648_ide_dma_test_irq (ide_drive_t *drive)
285static int cmd64x_ide_dma_test_irq (ide_drive_t *drive) 285static int cmd64x_ide_dma_test_irq (ide_drive_t *drive)
286{ 286{
287 ide_hwif_t *hwif = HWIF(drive); 287 ide_hwif_t *hwif = HWIF(drive);
288 struct pci_dev *dev = hwif->pci_dev; 288 struct pci_dev *dev = to_pci_dev(hwif->dev);
289 int irq_reg = hwif->channel ? ARTTIM23 : CFR; 289 int irq_reg = hwif->channel ? ARTTIM23 : CFR;
290 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 : 290 u8 irq_mask = hwif->channel ? ARTTIM23_INTR_CH1 :
291 CFR_INTR_CH0; 291 CFR_INTR_CH0;
@@ -375,7 +375,7 @@ static unsigned int __devinit init_chipset_cmd64x(struct pci_dev *dev, const cha
375 375
376static u8 __devinit ata66_cmd64x(ide_hwif_t *hwif) 376static u8 __devinit ata66_cmd64x(ide_hwif_t *hwif)
377{ 377{
378 struct pci_dev *dev = hwif->pci_dev; 378 struct pci_dev *dev = to_pci_dev(hwif->dev);
379 u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01; 379 u8 bmidecsr = 0, mask = hwif->channel ? 0x02 : 0x01;
380 380
381 switch (dev->device) { 381 switch (dev->device) {
@@ -390,7 +390,7 @@ static u8 __devinit ata66_cmd64x(ide_hwif_t *hwif)
390 390
391static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif) 391static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
392{ 392{
393 struct pci_dev *dev = hwif->pci_dev; 393 struct pci_dev *dev = to_pci_dev(hwif->dev);
394 394
395 hwif->set_pio_mode = &cmd64x_set_pio_mode; 395 hwif->set_pio_mode = &cmd64x_set_pio_mode;
396 hwif->set_dma_mode = &cmd64x_set_dma_mode; 396 hwif->set_dma_mode = &cmd64x_set_dma_mode;