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.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 054626497be4..9d1a3038af9b 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -112,10 +112,9 @@ static void
112sgiioc4_maskproc(ide_drive_t * drive, int mask) 112sgiioc4_maskproc(ide_drive_t * drive, int mask)
113{ 113{
114 writeb(mask ? (drive->ctl | 2) : (drive->ctl & ~2), 114 writeb(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
115 (void __iomem *)IDE_CONTROL_REG); 115 (void __iomem *)drive->hwif->io_ports[IDE_CONTROL_OFFSET]);
116} 116}
117 117
118
119static int 118static int
120sgiioc4_checkirq(ide_hwif_t * hwif) 119sgiioc4_checkirq(ide_hwif_t * hwif)
121{ 120{
@@ -142,18 +141,18 @@ sgiioc4_clearirq(ide_drive_t * drive)
142 intr_reg = readl((void __iomem *)other_ir); 141 intr_reg = readl((void __iomem *)other_ir);
143 if (intr_reg & 0x03) { /* Valid IOC4-IDE interrupt */ 142 if (intr_reg & 0x03) { /* Valid IOC4-IDE interrupt */
144 /* 143 /*
145 * Using sgiioc4_INB to read the IDE_STATUS_REG has a side effect 144 * Using sgiioc4_INB to read the Status register has a side
146 * of clearing the interrupt. The first read should clear it 145 * effect of clearing the interrupt. The first read should
147 * if it is set. The second read should return a "clear" status 146 * clear it if it is set. The second read should return
148 * if it got cleared. If not, then spin for a bit trying to 147 * a "clear" status if it got cleared. If not, then spin
149 * clear it. 148 * for a bit trying to clear it.
150 */ 149 */
151 u8 stat = sgiioc4_INB(IDE_STATUS_REG); 150 u8 stat = sgiioc4_INB(hwif->io_ports[IDE_STATUS_OFFSET]);
152 int count = 0; 151 int count = 0;
153 stat = sgiioc4_INB(IDE_STATUS_REG); 152 stat = sgiioc4_INB(hwif->io_ports[IDE_STATUS_OFFSET]);
154 while ((stat & 0x80) && (count++ < 100)) { 153 while ((stat & 0x80) && (count++ < 100)) {
155 udelay(1); 154 udelay(1);
156 stat = sgiioc4_INB(IDE_STATUS_REG); 155 stat = sgiioc4_INB(hwif->io_ports[IDE_STATUS_OFFSET]);
157 } 156 }
158 157
159 if (intr_reg & 0x02) { 158 if (intr_reg & 0x02) {
@@ -562,7 +561,6 @@ ide_init_sgiioc4(ide_hwif_t * hwif)
562 clear interrupts */ 561 clear interrupts */
563 hwif->maskproc = &sgiioc4_maskproc; /* Mask on/off NIEN register */ 562 hwif->maskproc = &sgiioc4_maskproc; /* Mask on/off NIEN register */
564 hwif->quirkproc = NULL; 563 hwif->quirkproc = NULL;
565 hwif->busproc = NULL;
566 564
567 hwif->INB = &sgiioc4_INB; 565 hwif->INB = &sgiioc4_INB;
568 566