diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-07-23 13:55:56 -0400 |
commit | 374e042c3e767ac2e5a40b78529220e0b3de793c (patch) | |
tree | 433d258f6da9783f0cb34234af9c359353f531fe /drivers/ide/ppc/pmac.c | |
parent | d6276b5f5cc7508124de291f3ed59c6945c17ae7 (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/ppc/pmac.c')
-rw-r--r-- | drivers/ide/ppc/pmac.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index ed073c6635a8..ee557d10a764 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -974,6 +974,21 @@ static void pmac_ide_init_dev(ide_drive_t *drive) | |||
974 | } | 974 | } |
975 | } | 975 | } |
976 | 976 | ||
977 | static const struct ide_tp_ops pmac_tp_ops = { | ||
978 | .exec_command = pmac_exec_command, | ||
979 | .read_status = ide_read_status, | ||
980 | .read_altstatus = ide_read_altstatus, | ||
981 | .read_sff_dma_status = ide_read_sff_dma_status, | ||
982 | |||
983 | .set_irq = pmac_set_irq, | ||
984 | |||
985 | .tf_load = ide_tf_load, | ||
986 | .tf_read = ide_tf_read, | ||
987 | |||
988 | .input_data = ide_input_data, | ||
989 | .output_data = ide_output_data, | ||
990 | }; | ||
991 | |||
977 | static const struct ide_port_ops pmac_ide_ata6_port_ops = { | 992 | static const struct ide_port_ops pmac_ide_ata6_port_ops = { |
978 | .init_dev = pmac_ide_init_dev, | 993 | .init_dev = pmac_ide_init_dev, |
979 | .set_pio_mode = pmac_ide_set_pio_mode, | 994 | .set_pio_mode = pmac_ide_set_pio_mode, |
@@ -1003,10 +1018,11 @@ static const struct ide_port_info pmac_port_info = { | |||
1003 | .name = DRV_NAME, | 1018 | .name = DRV_NAME, |
1004 | .init_dma = pmac_ide_init_dma, | 1019 | .init_dma = pmac_ide_init_dma, |
1005 | .chipset = ide_pmac, | 1020 | .chipset = ide_pmac, |
1021 | .tp_ops = &pmac_tp_ops, | ||
1022 | .port_ops = &pmac_ide_port_ops, | ||
1006 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC | 1023 | #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC |
1007 | .dma_ops = &pmac_dma_ops, | 1024 | .dma_ops = &pmac_dma_ops, |
1008 | #endif | 1025 | #endif |
1009 | .port_ops = &pmac_ide_port_ops, | ||
1010 | .host_flags = IDE_HFLAG_SET_PIO_MODE_KEEP_DMA | | 1026 | .host_flags = IDE_HFLAG_SET_PIO_MODE_KEEP_DMA | |
1011 | IDE_HFLAG_POST_SET_MODE | | 1027 | IDE_HFLAG_POST_SET_MODE | |
1012 | IDE_HFLAG_MMIO | | 1028 | IDE_HFLAG_MMIO | |
@@ -1106,9 +1122,6 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw) | |||
1106 | if (hwif == NULL) | 1122 | if (hwif == NULL) |
1107 | return -ENOENT; | 1123 | return -ENOENT; |
1108 | 1124 | ||
1109 | hwif->exec_command = pmac_exec_command; | ||
1110 | hwif->set_irq = pmac_set_irq; | ||
1111 | |||
1112 | idx[0] = hwif->index; | 1125 | idx[0] = hwif->index; |
1113 | 1126 | ||
1114 | ide_device_add(idx, &d, hws); | 1127 | ide_device_add(idx, &d, hws); |