summaryrefslogtreecommitdiff
path: root/drivers/ide/cris/ide-cris.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 23:44:36 +0200
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 23:44:36 +0200
commit9567b349f7e7dd7e2483db99ee8e4a6fe0caca38 (patch)
tree29abab829b52a451567f8da4280d101fafa44527 /drivers/ide/cris/ide-cris.c
parent92d3ab27e8fd23d1a9dc3b69d17b2afb83e5c6f5 (diff)
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>
Diffstat (limited to 'drivers/ide/cris/ide-cris.c')
-rw-r--r--drivers/ide/cris/ide-cris.c52
1 files changed, 15 insertions, 37 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index aa263df76569..72ff63ed5f2b 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -673,12 +673,8 @@ cris_ide_inb(unsigned long reg)
return (unsigned char)cris_ide_inw(reg);
}
-static void cris_ide_input_data(ide_drive_t *, struct request *,
- void *, unsigned int);
-static void cris_ide_output_data(ide_drive_t *, struct request *,
- void *, unsigned int);
-static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int);
-static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int);
+static void cris_input_data(ide_drive_t *, struct request *, void *, unsigned);
+static void cris_output_data(ide_drive_t *, struct request *, void *, unsigned);
static void cris_dma_host_set(ide_drive_t *drive, int on)
{
@@ -816,10 +812,9 @@ static int __init init_e100_ide(void)
ide_init_port_data(hwif, hwif->index);
ide_init_port_hw(hwif, &hw);
- hwif->ata_input_data = &cris_ide_input_data;
- hwif->ata_output_data = &cris_ide_output_data;
- hwif->atapi_input_bytes = &cris_atapi_input_bytes;
- hwif->atapi_output_bytes = &cris_atapi_output_bytes;
+ hwif->input_data = cris_input_data;
+ hwif->output_data = cris_output_data;
+
hwif->OUTB = &cris_ide_outb;
hwif->OUTW = &cris_ide_outw;
hwif->OUTBSYNC = &cris_ide_outbsync;
@@ -849,17 +844,16 @@ static int __init init_e100_ide(void)
static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16)));
/*
- * The following routines are mainly used by the ATAPI drivers.
+ * This is used for most PIO data transfers *from* the IDE interface
*
* These routines will round up any request for an odd number of bytes,
* so if an odd bytecount is specified, be sure that there's at least one
* extra byte allocated for the buffer.
*/
-static void
-cris_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount)
+static void cris_input_data(ide_drive_t *drive, struct request *rq,
+ void *buffer, unsigned int bytecount)
{
- D(printk("atapi_input_bytes, buffer 0x%x, count %d\n",
- buffer, bytecount));
+ D(printk("input_data, buffer 0x%x, count %d\n", buffer, bytecount));
if(bytecount & 1) {
printk("warning, odd bytecount in cdrom_in_bytes = %d.\n", bytecount);
@@ -877,11 +871,13 @@ cris_atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount
LED_DISK_READ(0);
}
-static void
-cris_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount)
+/*
+ * This is used for most PIO data transfers *to* the IDE interface
+ */
+static void cris_output_data(ide_drive_t *drive, struct request *rq,
+ void *buffer, unsigned int bytecount)
{
- D(printk("atapi_output_bytes, buffer 0x%x, count %d\n",
- buffer, bytecount));
+ D(printk("output_data, buffer 0x%x, count %d\n", buffer, bytecount));
if(bytecount & 1) {
printk("odd bytecount %d in atapi_out_bytes!\n", bytecount);
@@ -899,24 +895,6 @@ cris_atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecoun
LED_DISK_WRITE(0);
}
-/*
- * This is used for most PIO data transfers *from* the IDE interface
- */
-static void cris_ide_input_data(ide_drive_t *drive, struct request *rq,
- void *buffer, unsigned int wcount)
-{
- cris_atapi_input_bytes(drive, buffer, wcount << 2);
-}
-
-/*
- * This is used for most PIO data transfers *to* the IDE interface
- */
-static void cris_ide_output_data(ide_drive_t *drive, struct request *,
- void *buffer, unsigned int wcount)
-{
- cris_atapi_output_bytes(drive, buffer, wcount << 2);
-}
-
/* we only have one DMA channel on the chip for ATA, so we can keep these statically */
static cris_dma_descr_type ata_descrs[MAX_DMA_DESCRS] __attribute__ ((__aligned__(16)));
static unsigned int ata_tot_size;