aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r--drivers/ide/ide-probe.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 33cb5e5a249b..10ccf278d5be 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -271,7 +271,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
271 /* take a deep breath */ 271 /* take a deep breath */
272 msleep(50); 272 msleep(50);
273 273
274 if (IDE_CONTROL_REG) { 274 if (hwif->io_ports[IDE_CONTROL_OFFSET]) {
275 a = ide_read_altstatus(drive); 275 a = ide_read_altstatus(drive);
276 s = ide_read_status(drive); 276 s = ide_read_status(drive);
277 if ((a ^ s) & ~INDEX_STAT) 277 if ((a ^ s) & ~INDEX_STAT)
@@ -289,10 +289,10 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
289 */ 289 */
290 if ((cmd == WIN_PIDENTIFY)) 290 if ((cmd == WIN_PIDENTIFY))
291 /* disable dma & overlap */ 291 /* disable dma & overlap */
292 hwif->OUTB(0, IDE_FEATURE_REG); 292 hwif->OUTB(0, hwif->io_ports[IDE_FEATURE_OFFSET]);
293 293
294 /* ask drive for ID */ 294 /* ask drive for ID */
295 hwif->OUTB(cmd, IDE_COMMAND_REG); 295 hwif->OUTB(cmd, hwif->io_ports[IDE_COMMAND_OFFSET]);
296 296
297 timeout = ((cmd == WIN_IDENTIFY) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2; 297 timeout = ((cmd == WIN_IDENTIFY) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2;
298 timeout += jiffies; 298 timeout += jiffies;
@@ -353,7 +353,7 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd)
353 * interrupts during the identify-phase that 353 * interrupts during the identify-phase that
354 * the irq handler isn't expecting. 354 * the irq handler isn't expecting.
355 */ 355 */
356 if (IDE_CONTROL_REG) { 356 if (hwif->io_ports[IDE_CONTROL_OFFSET]) {
357 if (!hwif->irq) { 357 if (!hwif->irq) {
358 autoprobe = 1; 358 autoprobe = 1;
359 cookie = probe_irq_on(); 359 cookie = probe_irq_on();
@@ -445,7 +445,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
445 msleep(50); 445 msleep(50);
446 SELECT_DRIVE(drive); 446 SELECT_DRIVE(drive);
447 msleep(50); 447 msleep(50);
448 if (hwif->INB(IDE_SELECT_REG) != drive->select.all && !drive->present) { 448 if (hwif->INB(hwif->io_ports[IDE_SELECT_OFFSET]) != drive->select.all &&
449 !drive->present) {
449 if (drive->select.b.unit != 0) { 450 if (drive->select.b.unit != 0) {
450 /* exit with drive0 selected */ 451 /* exit with drive0 selected */
451 SELECT_DRIVE(&hwif->drives[0]); 452 SELECT_DRIVE(&hwif->drives[0]);
@@ -477,9 +478,11 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
477 printk(KERN_ERR "%s: no response (status = 0x%02x), " 478 printk(KERN_ERR "%s: no response (status = 0x%02x), "
478 "resetting drive\n", drive->name, stat); 479 "resetting drive\n", drive->name, stat);
479 msleep(50); 480 msleep(50);
480 hwif->OUTB(drive->select.all, IDE_SELECT_REG); 481 hwif->OUTB(drive->select.all,
482 hwif->io_ports[IDE_SELECT_OFFSET]);
481 msleep(50); 483 msleep(50);
482 hwif->OUTB(WIN_SRST, IDE_COMMAND_REG); 484 hwif->OUTB(WIN_SRST,
485 hwif->io_ports[IDE_COMMAND_OFFSET]);
483 (void)ide_busy_sleep(hwif); 486 (void)ide_busy_sleep(hwif);
484 rc = try_to_identify(drive, cmd); 487 rc = try_to_identify(drive, cmd);
485 } 488 }
@@ -515,7 +518,7 @@ static void enable_nest (ide_drive_t *drive)
515 printk("%s: enabling %s -- ", hwif->name, drive->id->model); 518 printk("%s: enabling %s -- ", hwif->name, drive->id->model);
516 SELECT_DRIVE(drive); 519 SELECT_DRIVE(drive);
517 msleep(50); 520 msleep(50);
518 hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG); 521 hwif->OUTB(EXABYTE_ENABLE_NEST, hwif->io_ports[IDE_COMMAND_OFFSET]);
519 522
520 if (ide_busy_sleep(hwif)) { 523 if (ide_busy_sleep(hwif)) {
521 printk(KERN_CONT "failed (timeout)\n"); 524 printk(KERN_CONT "failed (timeout)\n");