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 | 85e39035ca381846b031690f4d1ac1f0660da0a2 (patch) | |
tree | ebdf6b4b173e3e11ce876b8b7b91651a60945f91 /drivers/ide/ide-atapi.c | |
parent | 6b0da28b2d0f4f4e2c55689fc062db569075ff60 (diff) |
ide: add ->pc_{update,io}_buffers methods
Add ->pc_{update,io}_buffers methods to ide_drive_t and use
them instead of {update,io}_buffers ide_pc_intr() arguments.
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-atapi.c')
-rw-r--r-- | drivers/ide/ide-atapi.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/ide/ide-atapi.c b/drivers/ide/ide-atapi.c index d758dcd87178..f46bc5124e00 100644 --- a/drivers/ide/ide-atapi.c +++ b/drivers/ide/ide-atapi.c | |||
@@ -246,10 +246,7 @@ int ide_scsi_expiry(ide_drive_t *drive) | |||
246 | } | 246 | } |
247 | EXPORT_SYMBOL_GPL(ide_scsi_expiry); | 247 | EXPORT_SYMBOL_GPL(ide_scsi_expiry); |
248 | 248 | ||
249 | /* TODO: unify the code thus making some arguments go away */ | 249 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler) |
250 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler, | ||
251 | void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), | ||
252 | int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int)) | ||
253 | { | 250 | { |
254 | struct ide_atapi_pc *pc = drive->pc; | 251 | struct ide_atapi_pc *pc = drive->pc; |
255 | ide_hwif_t *hwif = drive->hwif; | 252 | ide_hwif_t *hwif = drive->hwif; |
@@ -290,8 +287,8 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, ide_handler_t *handler, | |||
290 | pc->flags |= PC_FLAG_DMA_ERROR; | 287 | pc->flags |= PC_FLAG_DMA_ERROR; |
291 | } else { | 288 | } else { |
292 | pc->xferred = pc->req_xfer; | 289 | pc->xferred = pc->req_xfer; |
293 | if (update_buffers) | 290 | if (drive->pc_update_buffers) |
294 | update_buffers(drive, pc); | 291 | drive->pc_update_buffers(drive, pc); |
295 | } | 292 | } |
296 | debug_log("%s: DMA finished\n", drive->name); | 293 | debug_log("%s: DMA finished\n", drive->name); |
297 | } | 294 | } |
@@ -386,7 +383,8 @@ cmd_finished: | |||
386 | temp = 0; | 383 | temp = 0; |
387 | if (temp) { | 384 | if (temp) { |
388 | if (pc->sg) | 385 | if (pc->sg) |
389 | io_buffers(drive, pc, temp, 0); | 386 | drive->pc_io_buffers(drive, pc, |
387 | temp, 0); | ||
390 | else | 388 | else |
391 | tp_ops->input_data(drive, NULL, | 389 | tp_ops->input_data(drive, NULL, |
392 | pc->cur_pos, temp); | 390 | pc->cur_pos, temp); |
@@ -410,7 +408,7 @@ cmd_finished: | |||
410 | if ((drive->media == ide_floppy && !scsi && !pc->buf) || | 408 | if ((drive->media == ide_floppy && !scsi && !pc->buf) || |
411 | (drive->media == ide_tape && !scsi && pc->bh) || | 409 | (drive->media == ide_tape && !scsi && pc->bh) || |
412 | (scsi && pc->sg)) { | 410 | (scsi && pc->sg)) { |
413 | int done = io_buffers(drive, pc, bcount, | 411 | int done = drive->pc_io_buffers(drive, pc, bcount, |
414 | !!(pc->flags & PC_FLAG_WRITING)); | 412 | !!(pc->flags & PC_FLAG_WRITING)); |
415 | 413 | ||
416 | /* FIXME: don't do partial completions */ | 414 | /* FIXME: don't do partial completions */ |