aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sgiioc4.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:56 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:56 -0400
commit374e042c3e767ac2e5a40b78529220e0b3de793c (patch)
tree433d258f6da9783f0cb34234af9c359353f531fe /drivers/ide/pci/sgiioc4.c
parentd6276b5f5cc7508124de291f3ed59c6945c17ae7 (diff)
ide: add struct ide_tp_ops (take 2)
* Add struct ide_tp_ops for transport methods. * Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info and ide_hwif_t. * Set the default hwif->tp_ops in ide_init_port_data(). * Set host driver specific hwif->tp_ops in ide_init_port(). * Export ide_exec_command(), ide_read_status(), ide_read_altstatus(), ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}() and ata_{in,out}put_data(). * Convert host drivers and core code to use struct ide_tp_ops. * Remove no longer needed default_hwif_transport(). * Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops. While at it: * Use struct ide_port_info in falconide.c and q40ide.c. * Rename ata_{in,out}put_data() to ide_{in,out}put_data(). v2: * Fix missing convertion in ns87415.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/sgiioc4.c')
-rw-r--r--drivers/ide/pci/sgiioc4.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 86f7c4901837..5598bd5936d9 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -550,6 +550,21 @@ static int sgiioc4_dma_setup(ide_drive_t *drive)
550 return 0; 550 return 0;
551} 551}
552 552
553static const struct ide_tp_ops sgiioc4_tp_ops = {
554 .exec_command = ide_exec_command,
555 .read_status = sgiioc4_read_status,
556 .read_altstatus = ide_read_altstatus,
557 .read_sff_dma_status = ide_read_sff_dma_status,
558
559 .set_irq = ide_set_irq,
560
561 .tf_load = ide_tf_load,
562 .tf_read = ide_tf_read,
563
564 .input_data = ide_input_data,
565 .output_data = ide_output_data,
566};
567
553static const struct ide_port_ops sgiioc4_port_ops = { 568static const struct ide_port_ops sgiioc4_port_ops = {
554 .set_dma_mode = sgiioc4_set_dma_mode, 569 .set_dma_mode = sgiioc4_set_dma_mode,
555 /* reset DMA engine, clear IRQs */ 570 /* reset DMA engine, clear IRQs */
@@ -572,6 +587,7 @@ static const struct ide_port_info sgiioc4_port_info __devinitdata = {
572 .name = DRV_NAME, 587 .name = DRV_NAME,
573 .chipset = ide_pci, 588 .chipset = ide_pci,
574 .init_dma = ide_dma_sgiioc4, 589 .init_dma = ide_dma_sgiioc4,
590 .tp_ops = &sgiioc4_tp_ops,
575 .port_ops = &sgiioc4_port_ops, 591 .port_ops = &sgiioc4_port_ops,
576 .dma_ops = &sgiioc4_dma_ops, 592 .dma_ops = &sgiioc4_dma_ops,
577 .host_flags = IDE_HFLAG_MMIO, 593 .host_flags = IDE_HFLAG_MMIO,
@@ -626,8 +642,6 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
626 /* Initializing chipset IRQ Registers */ 642 /* Initializing chipset IRQ Registers */
627 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); 643 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
628 644
629 hwif->read_status = sgiioc4_read_status;
630
631 idx[0] = hwif->index; 645 idx[0] = hwif->index;
632 646
633 if (ide_device_add(idx, &d, hws)) 647 if (ide_device_add(idx, &d, hws))