Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137660
b: refs/heads/master
c: 03a2faa
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Mar 27, 2009
1 parent 5b3c9a4 commit d6ff4b0
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ee38302ffc63da93eb0313053a990bb3466e275
refs/heads/master: 03a2faaea8f44edfe583ddf1240948019becfbe4
12 changes: 11 additions & 1 deletion trunk/drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)

/* No more interrupts */
if ((stat & ATA_DRQ) == 0) {
int uptodate;

debug_log("Packet command completed, %d bytes transferred\n",
pc->xferred);

Expand Down Expand Up @@ -395,7 +397,15 @@ static ide_startstop_t ide_pc_intr(ide_drive_t *drive)
dsc = 1;

/* Command finished - Call the callback function */
drive->pc_callback(drive, dsc);
uptodate = drive->pc_callback(drive, dsc);

if (uptodate == 0)
drive->failed_pc = NULL;

if (blk_special_request(rq))
ide_complete_rq(drive, 0);
else
ide_end_request(drive, uptodate, 0);

return ide_stopped;
}
Expand Down
12 changes: 4 additions & 8 deletions trunk/drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static void idefloppy_update_buffers(ide_drive_t *drive,
ide_end_request(drive, 1, 0);
}

static void ide_floppy_callback(ide_drive_t *drive, int dsc)
static int ide_floppy_callback(ide_drive_t *drive, int dsc)
{
struct ide_disk_obj *floppy = drive->driver_data;
struct ide_atapi_pc *pc = drive->pc;
Expand Down Expand Up @@ -108,14 +108,10 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc)
"Aborting request!\n");
}

if (uptodate == 0)
drive->failed_pc = NULL;

if (blk_special_request(rq)) {
if (blk_special_request(rq))
rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL;
ide_complete_rq(drive, 0);
} else
ide_end_request(drive, uptodate, 0);

return uptodate;
}

static void ide_floppy_report_error(struct ide_disk_obj *floppy,
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static void ide_tape_kfree_buffer(idetape_tape_t *tape)

static void ide_tape_handle_dsc(ide_drive_t *);

static void ide_tape_callback(ide_drive_t *drive, int dsc)
static int ide_tape_callback(ide_drive_t *drive, int dsc)
{
idetape_tape_t *tape = drive->driver_data;
struct ide_atapi_pc *pc = drive->pc;
Expand Down Expand Up @@ -530,13 +530,7 @@ static void ide_tape_callback(ide_drive_t *drive, int dsc)

rq->errors = err;

if (uptodate == 0)
drive->failed_pc = NULL;

if (blk_special_request(rq))
ide_complete_rq(drive, 0);
else
ide_end_request(drive, uptodate, 0);
return uptodate;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ struct ide_drive_s {
struct ide_atapi_pc *failed_pc;

/* callback for packet commands */
void (*pc_callback)(struct ide_drive_s *, int);
int (*pc_callback)(struct ide_drive_s *, int);

void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,
Expand Down

0 comments on commit d6ff4b0

Please sign in to comment.