ide: keep pointer to struct device instead of struct pci_dev in ide_hwif_t
[deliverable/linux.git] / drivers / ide / ppc / pmac.c
index 1d6af88242190a46cd5b282e2e02c933ccd7a25d..b17e097650b1fec8151e2f747d7853bb2f5f4e03 100644 (file)
@@ -1200,7 +1200,7 @@ pmac_ide_macio_attach(struct macio_dev *mdev, const struct of_device_id *match)
        base = ioremap(macio_resource_start(mdev, 0), 0x400);
        regbase = (unsigned long) base;
 
-       hwif->pci_dev = mdev->bus->pdev;
+       hwif->dev = &mdev->bus->pdev->dev;
 
        pmif->mdev = mdev;
        pmif->node = mdev->ofdev.node;
@@ -1315,7 +1315,7 @@ pmac_ide_pci_attach(struct pci_dev *pdev, const struct pci_device_id *id)
                return -ENXIO;
        }
 
-       hwif->pci_dev = pdev;
+       hwif->dev = &pdev->dev;
        pmif->mdev = NULL;
        pmif->node = np;
 
@@ -1725,10 +1725,12 @@ pmac_ide_dma_lost_irq (ide_drive_t *drive)
 static void __devinit
 pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
 {
+       struct pci_dev *dev = to_pci_dev(hwif->dev);
+
        /* We won't need pci_dev if we switch to generic consistent
         * DMA routines ...
         */
-       if (hwif->pci_dev == NULL)
+       if (dev == NULL)
                return;
        /*
         * Allocate space for the DBDMA commands.
@@ -1736,7 +1738,7 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t *hwif)
         * aligning the start address to a multiple of 16 bytes.
         */
        pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent(
-               hwif->pci_dev,
+               dev,
                (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd),
                &hwif->dmatable_dma);
        if (pmif->dma_table_cpu == NULL) {
This page took 0.04925 seconds and 5 git commands to generate.