]> err.no Git - linux-2.6/commitdiff
ide: add missing checks for control register existence
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 12 Dec 2007 22:31:57 +0000 (23:31 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Wed, 12 Dec 2007 22:31:57 +0000 (23:31 +0100)
Add missing checks for control register existence (some legacy m68k specific
IDE controllers don't have it).  Also use drive->ctl while at it.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c
drivers/ide/ide-probe.c

index db22d1ff4e559ff1eb2652de98b23e5c6ae22267..bef781fec5006d694069c614e2bda90ebec2b277 100644 (file)
@@ -970,7 +970,8 @@ static void ide_check_pm_state(ide_drive_t *drive, struct request *rq)
                if (rc)
                        printk(KERN_WARNING "%s: bus not ready on wakeup\n", drive->name);
                SELECT_DRIVE(drive);
-               HWIF(drive)->OUTB(8, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]);
+               if (IDE_CONTROL_REG)
+                       HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
                rc = ide_wait_not_busy(HWIF(drive), 100000);
                if (rc)
                        printk(KERN_WARNING "%s: drive not ready on wakeup\n", drive->name);
index ee848c7059954b091f14f200e89411ccfcd70109..bd0a6004a13bd03bdd3108ae5c381192df00794c 100644 (file)
@@ -667,7 +667,8 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
                /* Ignore disks that we will not probe for later. */
                if (!drive->noprobe || drive->present) {
                        SELECT_DRIVE(drive);
-                       hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
+                       if (IDE_CONTROL_REG)
+                               hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
                        mdelay(2);
                        rc = ide_wait_not_busy(hwif, 35000);
                        if (rc)