aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/ns87415.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:32 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-27 09:38:32 -0400
commit4c3032d8a4d6c97bd6e02bcab524ef2428d89561 (patch)
tree4528851a9b04282f602cebb6b2ab4bc677b63259 /drivers/ide/pci/ns87415.c
parent387750c3bf49c22f6189436032145e2131985076 (diff)
ide: add struct ide_io_ports (take 3)
* Add struct ide_io_ports and use it instead of `unsigned long io_ports[]` in ide_hwif_t. * Rename io_ports[] in hw_regs_t to io_ports_array[]. * Use un-named union for 'unsigned long io_ports_array[]' and 'struct ide_io_ports io_ports' in hw_regs_t. * Remove IDE_*_OFFSET defines. v2: * scc_pata.c build fix from Stephen Rothwell. v3: * Fix ctl_adrr typo in Sparc-specific part of ns87415.c. (Noticed by Andrew Morton) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/ns87415.c')
-rw-r--r--drivers/ide/pci/ns87415.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index e1b0c9a9ab9c..c13e299077ec 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -72,8 +72,8 @@ static void __devinit superio_ide_init_iops (struct hwif_s *hwif)
72 base = pci_resource_start(pdev, port * 2) & ~3; 72 base = pci_resource_start(pdev, port * 2) & ~3;
73 dmabase = pci_resource_start(pdev, 4) & ~3; 73 dmabase = pci_resource_start(pdev, 4) & ~3;
74 74
75 superio_ide_status[port] = base + IDE_STATUS_OFFSET; 75 superio_ide_status[port] = base + 7;
76 superio_ide_select[port] = base + IDE_SELECT_OFFSET; 76 superio_ide_select[port] = base + 6;
77 superio_ide_dma_status[port] = dmabase + (!port ? 2 : 0xa); 77 superio_ide_dma_status[port] = dmabase + (!port ? 2 : 0xa);
78 78
79 /* Clear error/interrupt, enable dma */ 79 /* Clear error/interrupt, enable dma */
@@ -231,12 +231,12 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
231 * SELECT_DRIVE() properly during first ide_probe_port(). 231 * SELECT_DRIVE() properly during first ide_probe_port().
232 */ 232 */
233 timeout = 10000; 233 timeout = 10000;
234 outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]); 234 outb(12, hwif->io_ports.ctl_addr);
235 udelay(10); 235 udelay(10);
236 outb(8, hwif->io_ports[IDE_CONTROL_OFFSET]); 236 outb(8, hwif->io_ports.ctl_addr);
237 do { 237 do {
238 udelay(50); 238 udelay(50);
239 stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); 239 stat = hwif->INB(hwif->io_ports.status_addr);
240 if (stat == 0xff) 240 if (stat == 0xff)
241 break; 241 break;
242 } while ((stat & BUSY_STAT) && --timeout); 242 } while ((stat & BUSY_STAT) && --timeout);
@@ -244,7 +244,7 @@ static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
244 } 244 }
245 245
246 if (!using_inta) 246 if (!using_inta)
247 hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET]); 247 hwif->irq = ide_default_irq(hwif->io_ports.data_addr);
248 else if (!hwif->irq && hwif->mate && hwif->mate->irq) 248 else if (!hwif->irq && hwif->mate && hwif->mate->irq)
249 hwif->irq = hwif->mate->irq; /* share IRQ with mate */ 249 hwif->irq = hwif->mate->irq; /* share IRQ with mate */
250 250