From 36501650ec45b1db308c3b51886044863be2d762 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 1 Feb 2008 23:09:31 +0100 Subject: 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 --- drivers/ide/ppc/pmac.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/ide/ppc/pmac.c') diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 1d6af882421..b17e097650b 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -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) { -- cgit v1.2.3