ide: add ->read_status method
* Remove ide_read_status() inline helper.
* Add ->read_status method for reading ATA Status register
and use it instead of ->INB.
While at it:
* Don't use HWGROUP() macro.
There should be no functional changes caused by this patch.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index d1e834a..c42fcfe 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -276,7 +276,7 @@
if (io_ports->ctl_addr) {
a = ide_read_altstatus(drive);
- s = ide_read_status(drive);
+ s = hwif->read_status(hwif);
if ((a ^ s) & ~INDEX_STAT)
/* ancient Seagate drives, broken interfaces */
printk(KERN_INFO "%s: probing with STATUS(0x%02x) "
@@ -307,12 +307,12 @@
/* give drive a breather */
msleep(50);
s = use_altstatus ? ide_read_altstatus(drive)
- : ide_read_status(drive);
+ : hwif->read_status(hwif);
} while (s & BUSY_STAT);
/* wait for IRQ and DRQ_STAT */
msleep(50);
- s = ide_read_status(drive);
+ s = hwif->read_status(hwif);
if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) {
unsigned long flags;
@@ -324,7 +324,7 @@
/* drive responded with ID */
rc = 0;
/* clear drive IRQ */
- (void)ide_read_status(drive);
+ (void)hwif->read_status(hwif);
local_irq_restore(flags);
} else {
/* drive refused ID */
@@ -371,7 +371,7 @@
ide_set_irq(drive, 0);
/* clear drive IRQ */
- (void)ide_read_status(drive);
+ (void)hwif->read_status(hwif);
udelay(5);
irq = probe_irq_off(cookie);
if (!hwif->irq) {
@@ -396,7 +396,7 @@
do {
msleep(50);
- stat = hwif->INB(hwif->io_ports.status_addr);
+ stat = hwif->read_status(hwif);
if ((stat & BUSY_STAT) == 0)
return 0;
} while (time_before(jiffies, timeout));
@@ -461,7 +461,7 @@
return 3;
}
- stat = ide_read_status(drive);
+ stat = hwif->read_status(hwif);
if (OK_STAT(stat, READY_STAT, BUSY_STAT) ||
drive->present || cmd == WIN_PIDENTIFY) {
@@ -471,7 +471,7 @@
rc = try_to_identify(drive,cmd);
}
- stat = ide_read_status(drive);
+ stat = hwif->read_status(hwif);
if (stat == (BUSY_STAT | READY_STAT))
return 4;
@@ -488,7 +488,7 @@
}
/* ensure drive IRQ is clear */
- stat = ide_read_status(drive);
+ stat = hwif->read_status(hwif);
if (rc == 1)
printk(KERN_ERR "%s: no response (status = 0x%02x)\n",
@@ -502,7 +502,7 @@
SELECT_DRIVE(&hwif->drives[0]);
msleep(50);
/* ensure drive irq is clear */
- (void)ide_read_status(drive);
+ (void)hwif->read_status(hwif);
}
return rc;
}
@@ -527,7 +527,7 @@
msleep(50);
- stat = ide_read_status(drive);
+ stat = hwif->read_status(hwif);
if (!OK_STAT(stat, 0, BAD_STAT))
printk(KERN_CONT "failed (status = 0x%02x)\n", stat);