aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/scc_pata.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/scc_pata.c')
-rw-r--r--drivers/ide/pci/scc_pata.c13
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
595static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif) 595static 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
637static void __devinit init_iops_scc(ide_hwif_t *hwif) 637static 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