diff options
-rw-r--r-- | drivers/ide/ide-atapi.c | 12 | ||||
-rw-r--r-- | drivers/ide/ide-floppy.c | 12 | ||||
-rw-r--r-- | drivers/ide/ide-tape.c | 10 | ||||
-rw-r--r-- | include/linux/ide.h | 2 |
4 files changed, 18 insertions, 18 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index f44474b0adae..f72b5a675435 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -357,6 +357,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) | |||
357 | 357 | ||
358 | /* No more interrupts */ | 358 | /* No more interrupts */ |
359 | if ((stat & ATA_DRQ) == 0) { | 359 | if ((stat & ATA_DRQ) == 0) { |
360 | int uptodate; | ||
361 | |||
360 | debug_log("Packet command completed, %d bytes transferred\n", | 362 | debug_log("Packet command completed, %d bytes transferred\n", |
361 | pc->xferred); | 363 | pc->xferred); |
362 | 364 | ||
@@ -395,7 +397,15 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive) | |||
395 | dsc = 1; | 397 | dsc = 1; |
396 | 398 | ||
397 | /* Command finished - Call the callback function */ | 399 | /* Command finished - Call the callback function */ |
398 | drive->pc_callback(drive, dsc); | 400 | uptodate = drive->pc_callback(drive, dsc); |
401 | |||
402 | if (uptodate == 0) | ||
403 | drive->failed_pc = NULL; | ||
404 | |||
405 | if (blk_special_request(rq)) | ||
406 | ide_complete_rq(drive, 0); | ||
407 | else | ||
408 | ide_end_request(drive, uptodate, 0); | ||
399 | 409 | ||
400 | return ide_stopped; | 410 | return ide_stopped; |
401 | } | 411 | } |
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index ab870a08d62b..5625946739ad 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -71,7 +71,7 @@ static void idefloppy_update_buffers(ide_drive_t *drive, | |||
71 | ide_end_request(drive, 1, 0); | 71 | ide_end_request(drive, 1, 0); |
72 | } | 72 | } |
73 | 73 | ||
74 | static void ide_floppy_callback(ide_drive_t *drive, int dsc) | 74 | static int ide_floppy_callback(ide_drive_t *drive, int dsc) |
75 | { | 75 | { |
76 | struct ide_disk_obj *floppy = drive->driver_data; | 76 | struct ide_disk_obj *floppy = drive->driver_data; |
77 | struct ide_atapi_pc *pc = drive->pc; | 77 | struct ide_atapi_pc *pc = drive->pc; |
@@ -108,14 +108,10 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) | |||
108 | "Aborting request!\n"); | 108 | "Aborting request!\n"); |
109 | } | 109 | } |
110 | 110 | ||
111 | if (uptodate == 0) | 111 | if (blk_special_request(rq)) |
112 | drive->failed_pc = NULL; | ||
113 | |||
114 | if (blk_special_request(rq)) { | ||
115 | rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL; | 112 | rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL; |
116 | ide_complete_rq(drive, 0); | 113 | |
117 | } else | 114 | return uptodate; |
118 | ide_end_request(drive, uptodate, 0); | ||
119 | } | 115 | } |
120 | 116 | ||
121 | static void ide_floppy_report_error(struct ide_disk_obj *floppy, | 117 | static void ide_floppy_report_error(struct ide_disk_obj *floppy, |
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c index fc61bbef3bb9..a42e49c6cc3f 100644 --- a/drivers/ide/ide-tape.c +++ b/drivers/ide/ide-tape.c | |||
@@ -463,7 +463,7 @@ static void ide_tape_kfree_buffer(idetape_tape_t *tape) | |||
463 | 463 | ||
464 | static void ide_tape_handle_dsc(ide_drive_t *); | 464 | static void ide_tape_handle_dsc(ide_drive_t *); |
465 | 465 | ||
466 | static void ide_tape_callback(ide_drive_t *drive, int dsc) | 466 | static int ide_tape_callback(ide_drive_t *drive, int dsc) |
467 | { | 467 | { |
468 | idetape_tape_t *tape = drive->driver_data; | 468 | idetape_tape_t *tape = drive->driver_data; |
469 | struct ide_atapi_pc *pc = drive->pc; | 469 | struct ide_atapi_pc *pc = drive->pc; |
@@ -530,13 +530,7 @@ static void ide_tape_callback(ide_drive_t *drive, int dsc) | |||
530 | 530 | ||
531 | rq->errors = err; | 531 | rq->errors = err; |
532 | 532 | ||
533 | if (uptodate == 0) | 533 | return uptodate; |
534 | drive->failed_pc = NULL; | ||
535 | |||
536 | if (blk_special_request(rq)) | ||
537 | ide_complete_rq(drive, 0); | ||
538 | else | ||
539 | ide_end_request(drive, uptodate, 0); | ||
540 | } | 534 | } |
541 | 535 | ||
542 | /* | 536 | /* |
diff --git a/include/linux/ide.h b/include/linux/ide.h index c2cdf7750185..9127d87cfa93 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -619,7 +619,7 @@ struct ide_drive_s { | |||
619 | struct ide_atapi_pc *failed_pc; | 619 | struct ide_atapi_pc *failed_pc; |
620 | 620 | ||
621 | /* callback for packet commands */ | 621 | /* callback for packet commands */ |
622 | void (*pc_callback)(struct ide_drive_s *, int); | 622 | int (*pc_callback)(struct ide_drive_s *, int); |
623 | 623 | ||
624 | void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *); | 624 | void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *); |
625 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, | 625 | int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *, |