diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:31 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-01 17:09:31 -0500 |
commit | 36501650ec45b1db308c3b51886044863be2d762 (patch) | |
tree | 74cf9d9f313e510f8424f9bac35da8d61cce9f7b /drivers/ide/pci/scc_pata.c | |
parent | f6fb786d6dcdd7d730e4fba620b071796f487e1b (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/scc_pata.c')
-rw-r--r-- | drivers/ide/pci/scc_pata.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index 24a85bbcd2a6..7694969b02ce 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
@@ -594,7 +594,7 @@ static int __devinit init_setup_scc(struct pci_dev *dev, | |||
594 | 594 | ||
595 | static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) | 595 | static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) |
596 | { | 596 | { |
597 | struct pci_dev *dev = hwif->pci_dev; | 597 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
598 | struct scc_ports *ports = pci_get_drvdata(dev); | 598 | struct scc_ports *ports = pci_get_drvdata(dev); |
599 | unsigned long dma_base = ports->dma; | 599 | unsigned long dma_base = ports->dma; |
600 | 600 | ||
@@ -620,7 +620,7 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) | |||
620 | hwif->io_ports[IDE_STATUS_OFFSET] = dma_base + 0x3c; | 620 | hwif->io_ports[IDE_STATUS_OFFSET] = dma_base + 0x3c; |
621 | hwif->io_ports[IDE_CONTROL_OFFSET] = dma_base + 0x40; | 621 | hwif->io_ports[IDE_CONTROL_OFFSET] = dma_base + 0x40; |
622 | 622 | ||
623 | hwif->irq = hwif->pci_dev->irq; | 623 | hwif->irq = dev->irq; |
624 | hwif->dma_base = dma_base; | 624 | hwif->dma_base = dma_base; |
625 | hwif->config_data = ports->ctl; | 625 | hwif->config_data = ports->ctl; |
626 | hwif->mmio = 1; | 626 | hwif->mmio = 1; |
@@ -636,7 +636,8 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) | |||
636 | 636 | ||
637 | static void __devinit init_iops_scc(ide_hwif_t *hwif) | 637 | static void __devinit init_iops_scc(ide_hwif_t *hwif) |
638 | { | 638 | { |
639 | struct pci_dev *dev = hwif->pci_dev; | 639 | struct pci_dev *dev = to_pci_dev(hwif->dev); |
640 | |||
640 | hwif->hwif_data = NULL; | 641 | hwif->hwif_data = NULL; |
641 | if (pci_get_drvdata(dev) == NULL) | 642 | if (pci_get_drvdata(dev) == NULL) |
642 | return; | 643 | return; |
@@ -726,10 +727,8 @@ static void __devexit scc_remove(struct pci_dev *dev) | |||
726 | unsigned long dma_size = pci_resource_len(dev, 1); | 727 | unsigned long dma_size = pci_resource_len(dev, 1); |
727 | 728 | ||
728 | if (hwif->dmatable_cpu) { | 729 | if (hwif->dmatable_cpu) { |
729 | pci_free_consistent(hwif->pci_dev, | 730 | pci_free_consistent(dev, PRD_ENTRIES * PRD_BYTES, |
730 | PRD_ENTRIES * PRD_BYTES, | 731 | hwif->dmatable_cpu, hwif->dmatable_dma); |
731 | hwif->dmatable_cpu, | ||
732 | hwif->dmatable_dma); | ||
733 | hwif->dmatable_cpu = NULL; | 732 | hwif->dmatable_cpu = NULL; |
734 | } | 733 | } |
735 | 734 | ||