summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-probe.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-18 00:46:26 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-18 00:46:26 +0200
commit23579a2a170265aacf78069f4817a41c1d6e9323 (patch)
treea20db3f337b64b13e482a2cb2f41e03b13d52e66 /drivers/ide/ide-probe.c
parent7616c0ad2087c7d244b8985390c63059a6223c45 (diff)
downloadop-kernel-dev-23579a2a170265aacf78069f4817a41c1d6e9323.zip
op-kernel-dev-23579a2a170265aacf78069f4817a41c1d6e9323.tar.gz
ide: remove IDE_*_REG macros
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines. * Remove IDE_*_REG macros - this results in more readable and slightly smaller code. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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 33cb5e5..10ccf27 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)
/* take a deep breath */
msleep(50);
- if (IDE_CONTROL_REG) {
+ if (hwif->io_ports[IDE_CONTROL_OFFSET]) {
a = ide_read_altstatus(drive);
s = ide_read_status(drive);
if ((a ^ s) & ~INDEX_STAT)
@@ -289,10 +289,10 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd)
*/
if ((cmd == WIN_PIDENTIFY))
/* disable dma & overlap */
- hwif->OUTB(0, IDE_FEATURE_REG);
+ hwif->OUTB(0, hwif->io_ports[IDE_FEATURE_OFFSET]);
/* ask drive for ID */
- hwif->OUTB(cmd, IDE_COMMAND_REG);
+ hwif->OUTB(cmd, hwif->io_ports[IDE_COMMAND_OFFSET]);
timeout = ((cmd == WIN_IDENTIFY) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2;
timeout += jiffies;
@@ -353,7 +353,7 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd)
* interrupts during the identify-phase that
* the irq handler isn't expecting.
*/
- if (IDE_CONTROL_REG) {
+ if (hwif->io_ports[IDE_CONTROL_OFFSET]) {
if (!hwif->irq) {
autoprobe = 1;
cookie = probe_irq_on();
@@ -445,7 +445,8 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
msleep(50);
SELECT_DRIVE(drive);
msleep(50);
- if (hwif->INB(IDE_SELECT_REG) != drive->select.all && !drive->present) {
+ if (hwif->INB(hwif->io_ports[IDE_SELECT_OFFSET]) != drive->select.all &&
+ !drive->present) {
if (drive->select.b.unit != 0) {
/* exit with drive0 selected */
SELECT_DRIVE(&hwif->drives[0]);
@@ -477,9 +478,11 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
printk(KERN_ERR "%s: no response (status = 0x%02x), "
"resetting drive\n", drive->name, stat);
msleep(50);
- hwif->OUTB(drive->select.all, IDE_SELECT_REG);
+ hwif->OUTB(drive->select.all,
+ hwif->io_ports[IDE_SELECT_OFFSET]);
msleep(50);
- hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);
+ hwif->OUTB(WIN_SRST,
+ hwif->io_ports[IDE_COMMAND_OFFSET]);
(void)ide_busy_sleep(hwif);
rc = try_to_identify(drive, cmd);
}
@@ -515,7 +518,7 @@ static void enable_nest (ide_drive_t *drive)
printk("%s: enabling %s -- ", hwif->name, drive->id->model);
SELECT_DRIVE(drive);
msleep(50);
- hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG);
+ hwif->OUTB(EXABYTE_ENABLE_NEST, hwif->io_ports[IDE_COMMAND_OFFSET]);
if (ide_busy_sleep(hwif)) {
printk(KERN_CONT "failed (timeout)\n");
OpenPOWER on IntegriCloud