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/pci/ns87415.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/ide/pci/ns87415.c') diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c index d4df4642dbb..bd05a4aae61 100644 --- a/drivers/ide/pci/ns87415.c +++ b/drivers/ide/pci/ns87415.c @@ -71,10 +71,9 @@ static u8 superio_ide_inb (unsigned long port) static void __devinit superio_ide_init_iops (struct hwif_s *hwif) { + struct pci_dev *pdev = to_pci_dev(hwif->dev); u32 base, dmabase; - u8 tmp; - struct pci_dev *pdev = hwif->pci_dev; - u8 port = hwif->channel; + u8 port = hwif->channel, tmp; base = pci_resource_start(pdev, port * 2) & ~3; dmabase = pci_resource_start(pdev, 4) & ~3; @@ -93,10 +92,11 @@ static void __devinit superio_ide_init_iops (struct hwif_s *hwif) static void __devinit init_iops_ns87415(ide_hwif_t *hwif) { - if (PCI_SLOT(hwif->pci_dev->devfn) == 0xE) { + struct pci_dev *dev = to_pci_dev(hwif->dev); + + if (PCI_SLOT(dev->devfn) == 0xE) /* Built-in - assume it's under superio. */ superio_ide_init_iops(hwif); - } } #endif @@ -110,8 +110,8 @@ static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 }; static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma) { ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = to_pci_dev(hwif->dev); unsigned int bit, other, new, *old = (unsigned int *) hwif->select_data; - struct pci_dev *dev = hwif->pci_dev; unsigned long flags; local_irq_save(flags); @@ -189,7 +189,7 @@ static int ns87415_ide_dma_setup(ide_drive_t *drive) static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif) { - struct pci_dev *dev = hwif->pci_dev; + struct pci_dev *dev = to_pci_dev(hwif->dev); unsigned int ctrl, using_inta; u8 progif; #ifdef __sparc_v9__ -- cgit v1.2.3-70-g09d2