aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-floppy.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-25 16:17:12 -0500
commit8e7657ae0f56c14882e53ffdae8055c2b1624de1 (patch)
tree93e8fbbf66d0a9f877b13d4534c6052713f3a268 /drivers/ide/ide-floppy.c
parent790d1239898d4f893112280decd344d90f43ee96 (diff)
ide: remove atapi_ireason_t (take 3)
Remove atapi_ireason_t. While at it: * replace 'HWIF(drive)' by 'drive->hwif' (or just 'hwif' where possible) v2: * v1 had CD and IO bits reversed in many places. * Use CD and IO defines from <linux/hdreg.h>. v3: * Fix incorrect "(ireason & IO) == test_bit()". (Noticed by Sergei) 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.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 239aebcfc359..830186fdcc74 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -788,12 +788,11 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
788{ 788{
789 idefloppy_floppy_t *floppy = drive->driver_data; 789 idefloppy_floppy_t *floppy = drive->driver_data;
790 ide_hwif_t *hwif = drive->hwif; 790 ide_hwif_t *hwif = drive->hwif;
791 atapi_ireason_t ireason;
792 idefloppy_pc_t *pc = floppy->pc; 791 idefloppy_pc_t *pc = floppy->pc;
793 struct request *rq = pc->rq; 792 struct request *rq = pc->rq;
794 unsigned int temp; 793 unsigned int temp;
795 u16 bcount; 794 u16 bcount;
796 u8 stat; 795 u8 stat, ireason;
797 796
798 debug_log(KERN_INFO "ide-floppy: Reached %s interrupt handler\n", 797 debug_log(KERN_INFO "ide-floppy: Reached %s interrupt handler\n",
799 __FUNCTION__); 798 __FUNCTION__);
@@ -852,18 +851,18 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive)
852 bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) | 851 bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
853 hwif->INB(IDE_BCOUNTL_REG); 852 hwif->INB(IDE_BCOUNTL_REG);
854 /* on this interrupt */ 853 /* on this interrupt */
855 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); 854 ireason = hwif->INB(IDE_IREASON_REG);
856 855
857 if (ireason.b.cod) { 856 if (ireason & CD) {
858 printk(KERN_ERR "ide-floppy: CoD != 0 in idefloppy_pc_intr\n"); 857 printk(KERN_ERR "ide-floppy: CoD != 0 in idefloppy_pc_intr\n");
859 return ide_do_reset(drive); 858 return ide_do_reset(drive);
860 } 859 }
861 if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) { 860 if (((ireason & IO) == IO) == test_bit(PC_WRITING, &pc->flags)) {
862 /* Hopefully, we will never get here */ 861 /* Hopefully, we will never get here */
863 printk(KERN_ERR "ide-floppy: We wanted to %s, ", 862 printk(KERN_ERR "ide-floppy: We wanted to %s, ",
864 ireason.b.io ? "Write":"Read"); 863 (ireason & IO) ? "Write" : "Read");
865 printk(KERN_ERR "but the floppy wants us to %s !\n", 864 printk(KERN_ERR "but the floppy wants us to %s !\n",
866 ireason.b.io ? "Read":"Write"); 865 (ireason & IO) ? "Read" : "Write");
867 return ide_do_reset(drive); 866 return ide_do_reset(drive);
868 } 867 }
869 if (!test_bit(PC_WRITING, &pc->flags)) { 868 if (!test_bit(PC_WRITING, &pc->flags)) {
@@ -920,15 +919,15 @@ static ide_startstop_t idefloppy_transfer_pc (ide_drive_t *drive)
920{ 919{
921 ide_startstop_t startstop; 920 ide_startstop_t startstop;
922 idefloppy_floppy_t *floppy = drive->driver_data; 921 idefloppy_floppy_t *floppy = drive->driver_data;
923 atapi_ireason_t ireason; 922 u8 ireason;
924 923
925 if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { 924 if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
926 printk(KERN_ERR "ide-floppy: Strange, packet command " 925 printk(KERN_ERR "ide-floppy: Strange, packet command "
927 "initiated yet DRQ isn't asserted\n"); 926 "initiated yet DRQ isn't asserted\n");
928 return startstop; 927 return startstop;
929 } 928 }
930 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); 929 ireason = drive->hwif->INB(IDE_IREASON_REG);
931 if (!ireason.b.cod || ireason.b.io) { 930 if ((ireason & CD) == 0 || (ireason & IO)) {
932 printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while " 931 printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while "
933 "issuing a packet command\n"); 932 "issuing a packet command\n");
934 return ide_do_reset(drive); 933 return ide_do_reset(drive);
@@ -968,15 +967,15 @@ static ide_startstop_t idefloppy_transfer_pc1 (ide_drive_t *drive)
968{ 967{
969 idefloppy_floppy_t *floppy = drive->driver_data; 968 idefloppy_floppy_t *floppy = drive->driver_data;
970 ide_startstop_t startstop; 969 ide_startstop_t startstop;
971 atapi_ireason_t ireason; 970 u8 ireason;
972 971
973 if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { 972 if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) {
974 printk(KERN_ERR "ide-floppy: Strange, packet command " 973 printk(KERN_ERR "ide-floppy: Strange, packet command "
975 "initiated yet DRQ isn't asserted\n"); 974 "initiated yet DRQ isn't asserted\n");
976 return startstop; 975 return startstop;
977 } 976 }
978 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); 977 ireason = drive->hwif->INB(IDE_IREASON_REG);
979 if (!ireason.b.cod || ireason.b.io) { 978 if ((ireason & CD) == 0 || (ireason & IO)) {
980 printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) " 979 printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) "
981 "while issuing a packet command\n"); 980 "while issuing a packet command\n");
982 return ide_do_reset(drive); 981 return ide_do_reset(drive);