Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+14 -9
+2 -2
drivers/ide/ide-io.c
··· 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 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);
+5 -2
drivers/ide/ide-iops.c
··· 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 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 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 }
+1 -1
drivers/ide/ide-lib.c
··· 487 487 else 488 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 492 if (lba48 || (tf->device & ATA_LBA)) 493 493 printk(", LBAsect=%llu",
+1 -1
drivers/ide/ide-taskfile.c
··· 109 109 110 110 if ((task->tf_flags & IDE_TFLAG_DMA_PIO_FALLBACK) == 0) { 111 111 ide_tf_dump(drive->name, tf); 112 - ide_tf_load(drive, task); 112 + hwif->tf_load(drive, task); 113 113 } 114 114 115 115 switch (task->data_phase) {
+5 -3
include/linux/ide.h
··· 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 */ ··· 468 466 469 467 const struct ide_port_ops *port_ops; 470 468 const struct ide_dma_ops *dma_ops; 469 + 470 + void (*tf_load)(ide_drive_t *, struct ide_task_s *); 471 + void (*tf_read)(ide_drive_t *, struct ide_task_s *); 471 472 472 473 void (*input_data)(ide_drive_t *, struct request *, void *, unsigned); 473 474 void (*output_data)(ide_drive_t *, struct request *, void *, unsigned); ··· 966 961 } ide_task_t; 967 962 968 963 void ide_tf_dump(const char *, struct ide_taskfile *); 969 - 970 - void ide_tf_load(ide_drive_t *, ide_task_t *); 971 - void ide_tf_read(ide_drive_t *, ide_task_t *); 972 964 973 965 extern void SELECT_DRIVE(ide_drive_t *); 974 966 extern void SELECT_MASK(ide_drive_t *, int);