diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:32 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-10-13 15:39:32 -0400 |
commit | 6b0da28b2d0f4f4e2c55689fc062db569075ff60 (patch) | |
tree | e7113f6db70fe3c2dd16bd2e7e1538fba4236c49 /drivers/ide/ide-floppy.c | |
parent | 67c56364df843fb9e3ed1af014b8fbe4b22ff25d (diff) |
ide: add ide_retry_pc() helper
* Add ide_create_request_sense_cmd() and ide_retry_pc() helpers
and convert ide-{atapi,floppy,tape}.c to use them.
* Remove no longer used ide*_create_request_sense_cmd(),
ide*_retry_pc() and 'retry_pc' argument from ide_pc_intr().
* Make ide_queue_pc_head() static.
There should be no functional changes caused by this patch.
Cc: Borislav Petkov <petkovbb@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-floppy.c')
-rw-r--r-- | drivers/ide/ide-floppy.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c index 6a1ade8ca9fe..6e62ffafc562 100644 --- a/drivers/ide/ide-floppy.c +++ b/drivers/ide/ide-floppy.c | |||
@@ -193,34 +193,11 @@ static void ide_floppy_callback(ide_drive_t *drive, int dsc) | |||
193 | idefloppy_end_request(drive, uptodate, 0); | 193 | idefloppy_end_request(drive, uptodate, 0); |
194 | } | 194 | } |
195 | 195 | ||
196 | void ide_floppy_create_request_sense_cmd(struct ide_atapi_pc *pc) | ||
197 | { | ||
198 | ide_init_pc(pc); | ||
199 | pc->c[0] = GPCMD_REQUEST_SENSE; | ||
200 | pc->c[4] = 255; | ||
201 | pc->req_xfer = 18; | ||
202 | } | ||
203 | |||
204 | /* | ||
205 | * Called when an error was detected during the last packet command. We queue a | ||
206 | * request sense packet command in the head of the request list. | ||
207 | */ | ||
208 | static void idefloppy_retry_pc(ide_drive_t *drive) | ||
209 | { | ||
210 | struct ide_floppy_obj *floppy = drive->driver_data; | ||
211 | struct request *rq = &drive->request_sense_rq; | ||
212 | struct ide_atapi_pc *pc = &drive->request_sense_pc; | ||
213 | |||
214 | (void)ide_read_error(drive); | ||
215 | ide_floppy_create_request_sense_cmd(pc); | ||
216 | ide_queue_pc_head(drive, floppy->disk, pc, rq); | ||
217 | } | ||
218 | |||
219 | /* The usual interrupt handler called during a packet command. */ | 196 | /* The usual interrupt handler called during a packet command. */ |
220 | static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) | 197 | static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive) |
221 | { | 198 | { |
222 | return ide_pc_intr(drive, idefloppy_pc_intr, idefloppy_update_buffers, | 199 | return ide_pc_intr(drive, idefloppy_pc_intr, idefloppy_update_buffers, |
223 | idefloppy_retry_pc, ide_io_buffers); | 200 | ide_io_buffers); |
224 | } | 201 | } |
225 | 202 | ||
226 | /* | 203 | /* |