diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:44 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-27 07:46:44 -0400 |
commit | a9587fd8c48415cc93fef7f4ba7748a5d3477e7b (patch) | |
tree | 310e6d5859c65a4b00395a5922e834defde06bcd | |
parent | 89f78b3261f7e331e41753ea2459fbb9b60a6f7a (diff) |
ide: remove BUG() from ide_complete_rq()
It is no longer needed so remove it, also while at it dequeue the request
only on blk_end_request() success and make ide_complete_rq() return an error
value.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/ide-io.c | 10 | ||||
-rw-r--r-- | include/linux/ide.h | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 28ac463dde1c..4a79d28600f5 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -141,15 +141,17 @@ void ide_complete_cmd(ide_drive_t *drive, struct ide_cmd *cmd, u8 stat, u8 err) | |||
141 | kfree(cmd); | 141 | kfree(cmd); |
142 | } | 142 | } |
143 | 143 | ||
144 | void ide_complete_rq(ide_drive_t *drive, int error) | 144 | int ide_complete_rq(ide_drive_t *drive, int error) |
145 | { | 145 | { |
146 | ide_hwif_t *hwif = drive->hwif; | 146 | ide_hwif_t *hwif = drive->hwif; |
147 | struct request *rq = hwif->rq; | 147 | struct request *rq = hwif->rq; |
148 | int rc; | ||
148 | 149 | ||
149 | hwif->rq = NULL; | 150 | rc = blk_end_request(rq, error, blk_rq_bytes(rq)); |
151 | if (rc == 0) | ||
152 | hwif->rq = NULL; | ||
150 | 153 | ||
151 | if (unlikely(blk_end_request(rq, error, blk_rq_bytes(rq)))) | 154 | return rc; |
152 | BUG(); | ||
153 | } | 155 | } |
154 | EXPORT_SYMBOL(ide_complete_rq); | 156 | EXPORT_SYMBOL(ide_complete_rq); |
155 | 157 | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index 32369d5797de..bb62bfaf02e0 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -1166,7 +1166,7 @@ extern int ide_devset_execute(ide_drive_t *drive, | |||
1166 | const struct ide_devset *setting, int arg); | 1166 | const struct ide_devset *setting, int arg); |
1167 | 1167 | ||
1168 | void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); | 1168 | void ide_complete_cmd(ide_drive_t *, struct ide_cmd *, u8, u8); |
1169 | void ide_complete_rq(ide_drive_t *, int); | 1169 | int ide_complete_rq(ide_drive_t *, int); |
1170 | 1170 | ||
1171 | void ide_tf_dump(const char *, struct ide_taskfile *); | 1171 | void ide_tf_dump(const char *, struct ide_taskfile *); |
1172 | 1172 | ||