ide: merge ->atapi_*put_bytes and ->ata_*put_data methods

* Merge ->atapi_{in,out}put_bytes and ->ata_{in,out}put_data methods
  into new ->{in,out}put_data methods which take number of bytes to
  transfer as an argument and always do padding.

While at it:

* Use 'hwif' or 'drive->hwif' instead of 'HWIF(drive)'.

There should be no functional changes caused by this patch (all users
of ->ata_{in,out}put_data methods were using multiply-of-4 word counts).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
Bartlomiej Zolnierkiewicz
2008-04-28 23:44:36 +02:00
parent 92d3ab27e8
commit 9567b349f7
12 changed files with 115 additions and 174 deletions

View File

@@ -231,6 +231,7 @@ static int idefloppy_end_request(ide_drive_t *drive, int uptodate, int nsecs)
static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
unsigned int bcount, int direction)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = pc->rq;
struct req_iterator iter;
struct bio_vec *bvec;
@@ -246,9 +247,9 @@ static void ide_floppy_io_buffers(ide_drive_t *drive, struct ide_atapi_pc *pc,
data = bvec_kmap_irq(bvec, &flags);
if (direction)
drive->hwif->atapi_output_bytes(drive, data, count);
hwif->output_data(drive, NULL, data, count);
else
drive->hwif->atapi_input_bytes(drive, data, count);
hwif->input_data(drive, NULL, data, count);
bvec_kunmap_irq(data, &flags);
bcount -= count;
@@ -503,12 +504,12 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
}
}
if (pc->flags & PC_FLAG_WRITING)
xferfunc = hwif->atapi_output_bytes;
xferfunc = hwif->output_data;
else
xferfunc = hwif->atapi_input_bytes;
xferfunc = hwif->input_data;
if (pc->buf)
xferfunc(drive, pc->cur_pos, bcount);
xferfunc(drive, NULL, pc->cur_pos, bcount);
else
ide_floppy_io_buffers(drive, pc, bcount,
!!(pc->flags & PC_FLAG_WRITING));
@@ -548,8 +549,10 @@ static ide_startstop_t idefloppy_transfer_pc(ide_drive_t *drive)
/* Set the interrupt routine */
ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL);
/* Send the actual packet */
HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12);
hwif->output_data(drive, NULL, floppy->pc->c, 12);
return ide_started;
}
@@ -569,7 +572,8 @@ static int idefloppy_transfer_pc2(ide_drive_t *drive)
idefloppy_floppy_t *floppy = drive->driver_data;
/* Send the actual packet */
HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12);
drive->hwif->output_data(drive, NULL, floppy->pc->c, 12);
/* Timeout for the packet command */
return IDEFLOPPY_WAIT_CMD;
}