aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sgiioc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/sgiioc4.c')
-rw-r--r--drivers/ide/pci/sgiioc4.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index b60a5e8860cd..85902074b1fc 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -159,6 +159,7 @@ sgiioc4_clearirq(ide_drive_t * drive)
159 } 159 }
160 160
161 if (intr_reg & 0x02) { 161 if (intr_reg & 0x02) {
162 struct pci_dev *dev = to_pci_dev(hwif->dev);
162 /* Error when transferring DMA data on PCI bus */ 163 /* Error when transferring DMA data on PCI bus */
163 u32 pci_err_addr_low, pci_err_addr_high, 164 u32 pci_err_addr_low, pci_err_addr_high,
164 pci_stat_cmd_reg; 165 pci_stat_cmd_reg;
@@ -167,7 +168,7 @@ sgiioc4_clearirq(ide_drive_t * drive)
167 readl((void __iomem *)hwif->io_ports[IDE_IRQ_OFFSET]); 168 readl((void __iomem *)hwif->io_ports[IDE_IRQ_OFFSET]);
168 pci_err_addr_high = 169 pci_err_addr_high =
169 readl((void __iomem *)(hwif->io_ports[IDE_IRQ_OFFSET] + 4)); 170 readl((void __iomem *)(hwif->io_ports[IDE_IRQ_OFFSET] + 4));
170 pci_read_config_dword(hwif->pci_dev, PCI_COMMAND, 171 pci_read_config_dword(dev, PCI_COMMAND,
171 &pci_stat_cmd_reg); 172 &pci_stat_cmd_reg);
172 printk(KERN_ERR 173 printk(KERN_ERR
173 "%s(%s) : PCI Bus Error when doing DMA:" 174 "%s(%s) : PCI Bus Error when doing DMA:"
@@ -178,8 +179,7 @@ sgiioc4_clearirq(ide_drive_t * drive)
178 __FUNCTION__, drive->name, 179 __FUNCTION__, drive->name,
179 pci_err_addr_high, pci_err_addr_low); 180 pci_err_addr_high, pci_err_addr_low);
180 /* Clear the PCI Error indicator */ 181 /* Clear the PCI Error indicator */
181 pci_write_config_dword(hwif->pci_dev, PCI_COMMAND, 182 pci_write_config_dword(dev, PCI_COMMAND, 0x00000146);
182 0x00000146);
183 } 183 }
184 184
185 /* Clear the Interrupt, Error bits on the IOC4 */ 185 /* Clear the Interrupt, Error bits on the IOC4 */
@@ -334,6 +334,7 @@ sgiioc4_INB(unsigned long port)
334static int __devinit 334static int __devinit
335ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base) 335ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
336{ 336{
337 struct pci_dev *dev = to_pci_dev(hwif->dev);
337 void __iomem *virt_dma_base; 338 void __iomem *virt_dma_base;
338 int num_ports = sizeof (ioc4_dma_regs_t); 339 int num_ports = sizeof (ioc4_dma_regs_t);
339 void *pad; 340 void *pad;
@@ -359,7 +360,7 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
359 } 360 }
360 hwif->dma_base = (unsigned long) virt_dma_base; 361 hwif->dma_base = (unsigned long) virt_dma_base;
361 362
362 hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, 363 hwif->dmatable_cpu = pci_alloc_consistent(dev,
363 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES, 364 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
364 &hwif->dmatable_dma); 365 &hwif->dmatable_dma);
365 366
@@ -368,7 +369,7 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
368 369
369 hwif->sg_max_nents = IOC4_PRD_ENTRIES; 370 hwif->sg_max_nents = IOC4_PRD_ENTRIES;
370 371
371 pad = pci_alloc_consistent(hwif->pci_dev, IOC4_IDE_CACHELINE_SIZE, 372 pad = pci_alloc_consistent(dev, IOC4_IDE_CACHELINE_SIZE,
372 (dma_addr_t *) &(hwif->dma_status)); 373 (dma_addr_t *) &(hwif->dma_status));
373 374
374 if (pad) { 375 if (pad) {
@@ -376,8 +377,7 @@ ide_dma_sgiioc4(ide_hwif_t * hwif, unsigned long dma_base)
376 return 0; 377 return 0;
377 } 378 }
378 379
379 pci_free_consistent(hwif->pci_dev, 380 pci_free_consistent(dev, IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
380 IOC4_PRD_ENTRIES * IOC4_PRD_BYTES,
381 hwif->dmatable_cpu, hwif->dmatable_dma); 381 hwif->dmatable_cpu, hwif->dmatable_dma);
382 printk(KERN_INFO 382 printk(KERN_INFO
383 "%s() -- Error! Unable to allocate DMA Maps for drive %s\n", 383 "%s() -- Error! Unable to allocate DMA Maps for drive %s\n",
@@ -640,7 +640,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
640 hw.dev = &dev->dev; 640 hw.dev = &dev->dev;
641 ide_init_port_hw(hwif, &hw); 641 ide_init_port_hw(hwif, &hw);
642 642
643 hwif->pci_dev = dev; 643 hwif->dev = &dev->dev;
644 hwif->channel = 0; /* Single Channel chip */ 644 hwif->channel = 0; /* Single Channel chip */
645 645
646 /* The IOC4 uses MMIO rather than Port IO. */ 646 /* The IOC4 uses MMIO rather than Port IO. */