Commit 94cd5b62ff9bb07ef065333eb97438f115a75890
1 parent
d309e0bb8e
Exists in
master
and in
20 other branches
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>
Showing 5 changed files with 14 additions and 9 deletions Side-by-side Diff
drivers/ide/ide-io.c
... | ... | @@ -330,7 +330,7 @@ |
330 | 330 | tf->error = err; |
331 | 331 | tf->status = stat; |
332 | 332 | |
333 | - ide_tf_read(drive, task); | |
333 | + drive->hwif->tf_read(drive, task); | |
334 | 334 | |
335 | 335 | if (task->tf_flags & IDE_TFLAG_DYN) |
336 | 336 | kfree(task); |
... | ... | @@ -1638,7 +1638,7 @@ |
1638 | 1638 | task.tf.lbah = (bcount >> 8) & 0xff; |
1639 | 1639 | |
1640 | 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 | |
1644 | 1644 | EXPORT_SYMBOL_GPL(ide_pktcmd_tf_load); |
drivers/ide/ide-iops.c
... | ... | @@ -127,7 +127,7 @@ |
127 | 127 | port_ops->maskproc(drive, mask); |
128 | 128 | } |
129 | 129 | |
130 | -void ide_tf_load(ide_drive_t *drive, ide_task_t *task) | |
130 | +static void ide_tf_load(ide_drive_t *drive, ide_task_t *task) | |
131 | 131 | { |
132 | 132 | ide_hwif_t *hwif = drive->hwif; |
133 | 133 | struct ide_io_ports *io_ports = &hwif->io_ports; |
... | ... | @@ -172,7 +172,7 @@ |
172 | 172 | io_ports->device_addr); |
173 | 173 | } |
174 | 174 | |
175 | -void ide_tf_read(ide_drive_t *drive, ide_task_t *task) | |
175 | +static void ide_tf_read(ide_drive_t *drive, ide_task_t *task) | |
176 | 176 | { |
177 | 177 | ide_hwif_t *hwif = drive->hwif; |
178 | 178 | struct ide_io_ports *io_ports = &hwif->io_ports; |
... | ... | @@ -323,6 +323,9 @@ |
323 | 323 | |
324 | 324 | void 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 | 329 | hwif->input_data = ata_input_data; |
327 | 330 | hwif->output_data = ata_output_data; |
328 | 331 | } |
drivers/ide/ide-lib.c
drivers/ide/ide-taskfile.c
include/linux/ide.h
... | ... | @@ -427,6 +427,8 @@ |
427 | 427 | void (*dma_timeout)(struct ide_drive_s *); |
428 | 428 | }; |
429 | 429 | |
430 | +struct ide_task_s; | |
431 | + | |
430 | 432 | typedef struct hwif_s { |
431 | 433 | struct hwif_s *next; /* for linked-list in ide_hwgroup_t */ |
432 | 434 | struct hwif_s *mate; /* other hwif from same PCI chip */ |
... | ... | @@ -467,6 +469,9 @@ |
467 | 469 | const struct ide_port_ops *port_ops; |
468 | 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 | 475 | void (*input_data)(ide_drive_t *, struct request *, void *, unsigned); |
471 | 476 | void (*output_data)(ide_drive_t *, struct request *, void *, unsigned); |
472 | 477 | |
... | ... | @@ -961,9 +966,6 @@ |
961 | 966 | } ide_task_t; |
962 | 967 | |
963 | 968 | void ide_tf_dump(const char *, struct ide_taskfile *); |
964 | - | |
965 | -void ide_tf_load(ide_drive_t *, ide_task_t *); | |
966 | -void ide_tf_read(ide_drive_t *, ide_task_t *); | |
967 | 969 | |
968 | 970 | extern void SELECT_DRIVE(ide_drive_t *); |
969 | 971 | extern void SELECT_MASK(ide_drive_t *, int); |