aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.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/scsi/ide-scsi.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/scsi/ide-scsi.c')
-rw-r--r--drivers/scsi/ide-scsi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 77e8a81228fc..ab7e8642cb88 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -398,10 +398,9 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
398 ide_hwif_t *hwif = drive->hwif; 398 ide_hwif_t *hwif = drive->hwif;
399 idescsi_pc_t *pc = scsi->pc; 399 idescsi_pc_t *pc = scsi->pc;
400 struct request *rq = pc->rq; 400 struct request *rq = pc->rq;
401 atapi_ireason_t ireason;
402 unsigned int temp; 401 unsigned int temp;
403 u16 bcount; 402 u16 bcount;
404 u8 stat; 403 u8 stat, ireason;
405 404
406#if IDESCSI_DEBUG_LOG 405#if IDESCSI_DEBUG_LOG
407 printk (KERN_INFO "ide-scsi: Reached idescsi_pc_intr interrupt handler\n"); 406 printk (KERN_INFO "ide-scsi: Reached idescsi_pc_intr interrupt handler\n");
@@ -439,13 +438,13 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
439 } 438 }
440 bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) | 439 bcount = (hwif->INB(IDE_BCOUNTH_REG) << 8) |
441 hwif->INB(IDE_BCOUNTL_REG); 440 hwif->INB(IDE_BCOUNTL_REG);
442 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); 441 ireason = hwif->INB(IDE_IREASON_REG);
443 442
444 if (ireason.b.cod) { 443 if (ireason & CD) {
445 printk(KERN_ERR "ide-scsi: CoD != 0 in idescsi_pc_intr\n"); 444 printk(KERN_ERR "ide-scsi: CoD != 0 in idescsi_pc_intr\n");
446 return ide_do_reset (drive); 445 return ide_do_reset (drive);
447 } 446 }
448 if (ireason.b.io) { 447 if (ireason & IO) {
449 temp = pc->actually_transferred + bcount; 448 temp = pc->actually_transferred + bcount;
450 if (temp > pc->request_transfer) { 449 if (temp > pc->request_transfer) {
451 if (temp > pc->buffer_size) { 450 if (temp > pc->buffer_size) {
@@ -474,7 +473,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
474#endif /* IDESCSI_DEBUG_LOG */ 473#endif /* IDESCSI_DEBUG_LOG */
475 } 474 }
476 } 475 }
477 if (ireason.b.io) { 476 if (ireason & IO) {
478 clear_bit(PC_WRITING, &pc->flags); 477 clear_bit(PC_WRITING, &pc->flags);
479 if (pc->sg) 478 if (pc->sg)
480 idescsi_input_buffers(drive, pc, bcount); 479 idescsi_input_buffers(drive, pc, bcount);
@@ -503,16 +502,16 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
503 ide_hwif_t *hwif = drive->hwif; 502 ide_hwif_t *hwif = drive->hwif;
504 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 503 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
505 idescsi_pc_t *pc = scsi->pc; 504 idescsi_pc_t *pc = scsi->pc;
506 atapi_ireason_t ireason;
507 ide_startstop_t startstop; 505 ide_startstop_t startstop;
506 u8 ireason;
508 507
509 if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { 508 if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) {
510 printk(KERN_ERR "ide-scsi: Strange, packet command " 509 printk(KERN_ERR "ide-scsi: Strange, packet command "
511 "initiated yet DRQ isn't asserted\n"); 510 "initiated yet DRQ isn't asserted\n");
512 return startstop; 511 return startstop;
513 } 512 }
514 ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); 513 ireason = hwif->INB(IDE_IREASON_REG);
515 if (!ireason.b.cod || ireason.b.io) { 514 if ((ireason & CD) == 0 || (ireason & IO)) {
516 printk(KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while " 515 printk(KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while "
517 "issuing a packet command\n"); 516 "issuing a packet command\n");
518 return ide_do_reset (drive); 517 return ide_do_reset (drive);