aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:40 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-28 17:44:40 -0400
commit94cd5b62ff9bb07ef065333eb97438f115a75890 (patch)
treec09f78987100b745ee5bb67df953469c0d24e618
parentd309e0bb8e5f29692f10790f3e966f05bbfc9355 (diff)
ide: add ->tf_load and ->tf_read methods
* Add ->tf_load and ->tf_read methods to ide_hwif_t and set the default methods in default_hwif_transport(). * Use ->tf_{load,read} instead o calling ide_tf_{load,read}() directly. * Make ide_tf_{load,read}() static. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-io.c4
-rw-r--r--drivers/ide/ide-iops.c7
-rw-r--r--drivers/ide/ide-lib.c2
-rw-r--r--drivers/ide/ide-taskfile.c2
-rw-r--r--include/linux/ide.h8
5 files changed, 14 insertions, 9 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 5b675a001382..8d7c1a09e1e7 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -330,7 +330,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
330 tf->error = err; 330 tf->error = err;
331 tf->status = stat; 331 tf->status = stat;
332 332
333 ide_tf_read(drive, task); 333 drive->hwif->tf_read(drive, task);
334 334
335 if (task->tf_flags & IDE_TFLAG_DYN) 335 if (task->tf_flags & IDE_TFLAG_DYN)
336 kfree(task); 336 kfree(task);
@@ -1638,7 +1638,7 @@ void ide_pktcmd_tf_load(ide_drive_t *drive, u32 tf_flags, u16 bcount, u8 dma)
1638 task.tf.lbah = (bcount >> 8) & 0xff; 1638 task.tf.lbah = (bcount >> 8) & 0xff;
1639 1639
1640 ide_tf_dump(drive->name, &task.tf); 1640 ide_tf_dump(drive->name, &task.tf);
1641 ide_tf_load(drive, &task); 1641 drive->hwif->tf_load(drive, &task);
1642} 1642}
1643 1643
1644EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load); 1644EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load);
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index ac9e063bcf93..65275454a209 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -127,7 +127,7 @@ void SELECT_MASK (ide_drive_t *drive, int mask)
127 port_ops->maskproc(drive, mask); 127 port_ops->maskproc(drive, mask);
128} 128}
129 129
130void ide_tf_load(ide_drive_t *drive, ide_task_t *task) 130static void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
131{ 131{
132 ide_hwif_t *hwif = drive->hwif; 132 ide_hwif_t *hwif = drive->hwif;
133 struct ide_io_ports *io_ports = &hwif->io_ports; 133 struct ide_io_ports *io_ports = &hwif->io_ports;
@@ -172,7 +172,7 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
172 io_ports->device_addr); 172 io_ports->device_addr);
173} 173}
174 174
175void ide_tf_read(ide_drive_t *drive, ide_task_t *task) 175static void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
176{ 176{
177 ide_hwif_t *hwif = drive->hwif; 177 ide_hwif_t *hwif = drive->hwif;
178 struct ide_io_ports *io_ports = &hwif->io_ports; 178 struct ide_io_ports *io_ports = &hwif->io_ports;
@@ -323,6 +323,9 @@ static void ata_output_data(ide_drive_t *drive, struct request *rq,
323 323
324void default_hwif_transport(ide_hwif_t *hwif) 324void default_hwif_transport(ide_hwif_t *hwif)
325{ 325{
326 hwif->tf_load = ide_tf_load;
327 hwif->tf_read = ide_tf_read;
328
326 hwif->input_data = ata_input_data; 329 hwif->input_data = ata_input_data;
327 hwif->output_data = ata_output_data; 330 hwif->output_data = ata_output_data;
328} 331}
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c
index 6f04ea3e93a8..47af80df6872 100644
--- a/drivers/ide/ide-lib.c
+++ b/drivers/ide/ide-lib.c
@@ -487,7 +487,7 @@ static void ide_dump_sector(ide_drive_t *drive)
487 else 487 else
488 task.tf_flags = IDE_TFLAG_IN_LBA | IDE_TFLAG_IN_DEVICE; 488 task.tf_flags = IDE_TFLAG_IN_LBA | IDE_TFLAG_IN_DEVICE;
489 489
490 ide_tf_read(drive, &task); 490 drive->hwif->tf_read(drive, &task);
491 491
492 if (lba48 || (tf->device & ATA_LBA)) 492 if (lba48 || (tf->device & ATA_LBA))
493 printk(", LBAsect=%llu", 493 printk(", LBAsect=%llu",
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 9ec3ecd4a3a5..9a846a0cd5a4 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -109,7 +109,7 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
109 109
110 if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) { 110 if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) {
111 ide_tf_dump(drive->name, tf); 111 ide_tf_dump(drive->name, tf);
112 ide_tf_load(drive, task); 112 hwif->tf_load(drive, task);
113 } 113 }
114 114
115 switch (task->data_phase) { 115 switch (task->data_phase) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d7d8bb69db4b..8e95579c3d34 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -427,6 +427,8 @@ struct ide_dma_ops {
427 void (*dma_timeout)(struct ide_drive_s *); 427 void (*dma_timeout)(struct ide_drive_s *);
428}; 428};
429 429
430struct ide_task_s;
431
430typedef struct hwif_s { 432typedef struct hwif_s {
431 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ 433 struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
432 struct hwif_s *mate; /* other hwif from same PCI chip */ 434 struct hwif_s *mate; /* other hwif from same PCI chip */
@@ -467,6 +469,9 @@ typedef struct hwif_s {
467 const struct ide_port_ops *port_ops; 469 const struct ide_port_ops *port_ops;
468 const struct ide_dma_ops *dma_ops; 470 const struct ide_dma_ops *dma_ops;
469 471
472 void (*tf_load)(ide_drive_t *, struct ide_task_s *);
473 void (*tf_read)(ide_drive_t *, struct ide_task_s *);
474
470 void (*input_data)(ide_drive_t *, struct request *, void *, unsigned); 475 void (*input_data)(ide_drive_t *, struct request *, void *, unsigned);
471 void (*output_data)(ide_drive_t *, struct request *, void *, unsigned); 476 void (*output_data)(ide_drive_t *, struct request *, void *, unsigned);
472 477
@@ -962,9 +967,6 @@ typedef struct ide_task_s {
962 967
963void ide_tf_dump(const char *, struct ide_taskfile *); 968void ide_tf_dump(const char *, struct ide_taskfile *);
964 969
965void ide_tf_load(ide_drive_t *, ide_task_t *);
966void ide_tf_read(ide_drive_t *, ide_task_t *);
967
968extern void SELECT_DRIVE(ide_drive_t *); 970extern void SELECT_DRIVE(ide_drive_t *);
969extern void SELECT_MASK(ide_drive_t *, int); 971extern void SELECT_MASK(ide_drive_t *, int);
970 972