diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-17 18:46:26 -0400 |
commit | 23579a2a170265aacf78069f4817a41c1d6e9323 (patch) | |
tree | a20db3f337b64b13e482a2cb2f41e03b13d52e66 /drivers/ide/ide-floppy.c | |
parent | 7616c0ad2087c7d244b8985390c63059a6223c45 (diff) |
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-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 170c60d93f55..4ce67bdb5d5e 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -498,10 +498,10 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive) | |||
498 | } | 498 | } |
499 | 499 | ||
500 | /* Get the number of bytes to transfer */ | 500 | /* Get the number of bytes to transfer */ |
501 | bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) | | 501 | bcount = (hwif->INB(hwif->io_ports[IDE_BCOUNTH_OFFSET]) << 8) | |
502 | hwif->INB(IDE_BCOUNTL_REG); | 502 | hwif->INB(hwif->io_ports[IDE_BCOUNTL_OFFSET]); |
503 | /* on this interrupt */ | 503 | /* on this interrupt */ |
504 | ireason = hwif->INB(IDE_IREASON_REG); | 504 | ireason = hwif->INB(hwif->io_ports[IDE_IREASON_OFFSET]); |
505 | 505 | ||
506 | if (ireason & CD) { | 506 | if (ireason & CD) { |
507 | printk(KERN_ERR "ide-floppy: CoD != 0 in %s\n", __func__); | 507 | printk(KERN_ERR "ide-floppy: CoD != 0 in %s\n", __func__); |
@@ -562,6 +562,7 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive) | |||
562 | */ | 562 | */ |
563 | static ide_startstop_t idefloppy_transfer_pc(ide_drive_t *drive) | 563 | static ide_startstop_t idefloppy_transfer_pc(ide_drive_t *drive) |
564 | { | 564 | { |
565 | ide_hwif_t *hwif = drive->hwif; | ||
565 | ide_startstop_t startstop; | 566 | ide_startstop_t startstop; |
566 | idefloppy_floppy_t *floppy = drive->driver_data; | 567 | idefloppy_floppy_t *floppy = drive->driver_data; |
567 | u8 ireason; | 568 | u8 ireason; |
@@ -571,7 +572,7 @@ static ide_startstop_t idefloppy_transfer_pc(ide_drive_t *drive) | |||
571 | "initiated yet DRQ isn't asserted\n"); | 572 | "initiated yet DRQ isn't asserted\n"); |
572 | return startstop; | 573 | return startstop; |
573 | } | 574 | } |
574 | ireason = drive->hwif->INB(IDE_IREASON_REG); | 575 | ireason = hwif->INB(hwif->io_ports[IDE_IREASON_OFFSET]); |
575 | if ((ireason & CD) == 0 || (ireason & IO)) { | 576 | if ((ireason & CD) == 0 || (ireason & IO)) { |
576 | printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while " | 577 | printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while " |
577 | "issuing a packet command\n"); | 578 | "issuing a packet command\n"); |
@@ -608,6 +609,7 @@ static int idefloppy_transfer_pc2(ide_drive_t *drive) | |||
608 | 609 | ||
609 | static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive) | 610 | static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive) |
610 | { | 611 | { |
612 | ide_hwif_t *hwif = drive->hwif; | ||
611 | idefloppy_floppy_t *floppy = drive->driver_data; | 613 | idefloppy_floppy_t *floppy = drive->driver_data; |
612 | ide_startstop_t startstop; | 614 | ide_startstop_t startstop; |
613 | u8 ireason; | 615 | u8 ireason; |
@@ -617,7 +619,7 @@ static ide_startstop_t idefloppy_transfer_pc1(ide_drive_t *drive) | |||
617 | "initiated yet DRQ isn't asserted\n"); | 619 | "initiated yet DRQ isn't asserted\n"); |
618 | return startstop; | 620 | return startstop; |
619 | } | 621 | } |
620 | ireason = drive->hwif->INB(IDE_IREASON_REG); | 622 | ireason = hwif->INB(hwif->io_ports[IDE_IREASON_OFFSET]); |
621 | if ((ireason & CD) == 0 || (ireason & IO)) { | 623 | if ((ireason & CD) == 0 || (ireason & IO)) { |
622 | printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) " | 624 | printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) " |
623 | "while issuing a packet command\n"); | 625 | "while issuing a packet command\n"); |
@@ -723,7 +725,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive, | |||
723 | return ide_started; | 725 | return ide_started; |
724 | } else { | 726 | } else { |
725 | /* Issue the packet command */ | 727 | /* Issue the packet command */ |
726 | HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); | 728 | hwif->OUTB(WIN_PACKETCMD, hwif->io_ports[IDE_COMMAND_OFFSET]); |
727 | return (*pkt_xfer_routine) (drive); | 729 | return (*pkt_xfer_routine) (drive); |
728 | } | 730 | } |
729 | } | 731 | } |