diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:52 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:52 -0400 |
commit | b73c7ee25da6133f97f47ffd3557288417da7c76 (patch) | |
tree | 0d348c81294d246b8417aff6e24502c93b312505 /drivers/ide/ide-probe.c | |
parent | c6dfa867bb45f4bff2e48f3bc89ab1d6a7ab4c21 (diff) |
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>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index d1e834a1c5cd..c42fcfedcbf6 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c | |||
@@ -276,7 +276,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
276 | 276 | ||
277 | if (io_ports->ctl_addr) { | 277 | if (io_ports->ctl_addr) { |
278 | a = ide_read_altstatus(drive); | 278 | a = ide_read_altstatus(drive); |
279 | s = ide_read_status(drive); | 279 | s = hwif->read_status(hwif); |
280 | if ((a ^ s) & ~INDEX_STAT) | 280 | if ((a ^ s) & ~INDEX_STAT) |
281 | /* ancient Seagate drives, broken interfaces */ | 281 | /* ancient Seagate drives, broken interfaces */ |
282 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " | 282 | printk(KERN_INFO "%s: probing with STATUS(0x%02x) " |
@@ -307,12 +307,12 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
307 | /* give drive a breather */ | 307 | /* give drive a breather */ |
308 | msleep(50); | 308 | msleep(50); |
309 | s = use_altstatus ? ide_read_altstatus(drive) | 309 | s = use_altstatus ? ide_read_altstatus(drive) |
310 | : ide_read_status(drive); | 310 | : hwif->read_status(hwif); |
311 | } while (s & BUSY_STAT); | 311 | } while (s & BUSY_STAT); |
312 | 312 | ||
313 | /* wait for IRQ and DRQ_STAT */ | 313 | /* wait for IRQ and DRQ_STAT */ |
314 | msleep(50); | 314 | msleep(50); |
315 | s = ide_read_status(drive); | 315 | s = hwif->read_status(hwif); |
316 | 316 | ||
317 | if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) { | 317 | if (OK_STAT(s, DRQ_STAT, BAD_R_STAT)) { |
318 | unsigned long flags; | 318 | unsigned long flags; |
@@ -324,7 +324,7 @@ static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) | |||
324 | /* drive responded with ID */ | 324 | /* drive responded with ID */ |
325 | rc = 0; | 325 | rc = 0; |
326 | /* clear drive IRQ */ | 326 | /* clear drive IRQ */ |
327 | (void)ide_read_status(drive); | 327 | (void)hwif->read_status(hwif); |
328 | local_irq_restore(flags); | 328 | local_irq_restore(flags); |
329 | } else { | 329 | } else { |
330 | /* drive refused ID */ | 330 | /* drive refused ID */ |
@@ -371,7 +371,7 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd) | |||
371 | 371 | ||
372 | ide_set_irq(drive, 0); | 372 | ide_set_irq(drive, 0); |
373 | /* clear drive IRQ */ | 373 | /* clear drive IRQ */ |
374 | (void)ide_read_status(drive); | 374 | (void)hwif->read_status(hwif); |
375 | udelay(5); | 375 | udelay(5); |
376 | irq = probe_irq_off(cookie); | 376 | irq = probe_irq_off(cookie); |
377 | if (!hwif->irq) { | 377 | if (!hwif->irq) { |
@@ -396,7 +396,7 @@ static int ide_busy_sleep(ide_hwif_t *hwif) | |||
396 | 396 | ||
397 | do { | 397 | do { |
398 | msleep(50); | 398 | msleep(50); |
399 | stat = hwif->INB(hwif->io_ports.status_addr); | 399 | stat = hwif->read_status(hwif); |
400 | if ((stat & BUSY_STAT) == 0) | 400 | if ((stat & BUSY_STAT) == 0) |
401 | return 0; | 401 | return 0; |
402 | } while (time_before(jiffies, timeout)); | 402 | } while (time_before(jiffies, timeout)); |
@@ -461,7 +461,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
461 | return 3; | 461 | return 3; |
462 | } | 462 | } |
463 | 463 | ||
464 | stat = ide_read_status(drive); | 464 | stat = hwif->read_status(hwif); |
465 | 465 | ||
466 | if (OK_STAT(stat, READY_STAT, BUSY_STAT) || | 466 | if (OK_STAT(stat, READY_STAT, BUSY_STAT) || |
467 | drive->present || cmd == WIN_PIDENTIFY) { | 467 | drive->present || cmd == WIN_PIDENTIFY) { |
@@ -471,7 +471,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
471 | rc = try_to_identify(drive,cmd); | 471 | rc = try_to_identify(drive,cmd); |
472 | } | 472 | } |
473 | 473 | ||
474 | stat = ide_read_status(drive); | 474 | stat = hwif->read_status(hwif); |
475 | 475 | ||
476 | if (stat == (BUSY_STAT | READY_STAT)) | 476 | if (stat == (BUSY_STAT | READY_STAT)) |
477 | return 4; | 477 | return 4; |
@@ -488,7 +488,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
488 | } | 488 | } |
489 | 489 | ||
490 | /* ensure drive IRQ is clear */ | 490 | /* ensure drive IRQ is clear */ |
491 | stat = ide_read_status(drive); | 491 | stat = hwif->read_status(hwif); |
492 | 492 | ||
493 | if (rc == 1) | 493 | if (rc == 1) |
494 | printk(KERN_ERR "%s: no response (status = 0x%02x)\n", | 494 | printk(KERN_ERR "%s: no response (status = 0x%02x)\n", |
@@ -502,7 +502,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd) | |||
502 | SELECT_DRIVE(&hwif->drives[0]); | 502 | SELECT_DRIVE(&hwif->drives[0]); |
503 | msleep(50); | 503 | msleep(50); |
504 | /* ensure drive irq is clear */ | 504 | /* ensure drive irq is clear */ |
505 | (void)ide_read_status(drive); | 505 | (void)hwif->read_status(hwif); |
506 | } | 506 | } |
507 | return rc; | 507 | return rc; |
508 | } | 508 | } |
@@ -527,7 +527,7 @@ static void enable_nest (ide_drive_t *drive) | |||
527 | 527 | ||
528 | msleep(50); | 528 | msleep(50); |
529 | 529 | ||
530 | stat = ide_read_status(drive); | 530 | stat = hwif->read_status(hwif); |
531 | 531 | ||
532 | if (!OK_STAT(stat, 0, BAD_STAT)) | 532 | if (!OK_STAT(stat, 0, BAD_STAT)) |
533 | printk(KERN_CONT "failed (status = 0x%02x)\n", stat); | 533 | printk(KERN_CONT "failed (status = 0x%02x)\n", stat); |