diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:14 -0400 |
commit | ac95beedf8bc97b24f9540d4da9952f07221c023 (patch) | |
tree | c29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/pci/scc_pata.c | |
parent | 4a27214d7be31e122db4102166f49ec15958e8e9 (diff) |
ide: add struct ide_port_ops (take 2)
* Move hooks for port/host specific methods from ide_hwif_t to
'struct ide_port_ops'.
* Add 'const struct ide_port_ops *port_ops' to 'struct ide_port_info'
and ide_hwif_t.
* Update host drivers and core code accordingly.
While at it:
* Rename ata66_*() cable detect functions to *_cable_detect() to match
the standard naming. (Suggested by Sergei Shtylyov)
v2:
* Fix build for bast-ide. (Noticed by Andrew Morton)
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/scc_pata.c')
-rw-r--r-- | drivers/ide/pci/scc_pata.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c index 52145796f12f..c01e2da5c9e6 100644 --- a/drivers/ide/pci/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
@@ -703,24 +703,27 @@ static void __devinit init_hwif_scc(ide_hwif_t *hwif) | |||
703 | 703 | ||
704 | hwif->dma_setup = scc_dma_setup; | 704 | hwif->dma_setup = scc_dma_setup; |
705 | hwif->ide_dma_end = scc_ide_dma_end; | 705 | hwif->ide_dma_end = scc_ide_dma_end; |
706 | hwif->set_pio_mode = scc_set_pio_mode; | ||
707 | hwif->set_dma_mode = scc_set_dma_mode; | ||
708 | hwif->ide_dma_test_irq = scc_dma_test_irq; | 706 | hwif->ide_dma_test_irq = scc_dma_test_irq; |
709 | hwif->udma_filter = scc_udma_filter; | ||
710 | 707 | ||
711 | if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN) | 708 | if (in_be32((void __iomem *)(hwif->config_data + 0xff0)) & CCKCTRL_ATACLKOEN) |
712 | hwif->ultra_mask = ATA_UDMA6; /* 133MHz */ | 709 | hwif->ultra_mask = ATA_UDMA6; /* 133MHz */ |
713 | else | 710 | else |
714 | hwif->ultra_mask = ATA_UDMA5; /* 100MHz */ | 711 | hwif->ultra_mask = ATA_UDMA5; /* 100MHz */ |
715 | |||
716 | hwif->cable_detect = scc_cable_detect; | ||
717 | } | 712 | } |
718 | 713 | ||
714 | static const struct ide_port_ops scc_port_ops = { | ||
715 | .set_pio_mode = scc_set_pio_mode, | ||
716 | .set_dma_mode = scc_set_dma_mode, | ||
717 | .udma_filter = scc_udma_filter, | ||
718 | .cable_detect = scc_cable_detect, | ||
719 | }; | ||
720 | |||
719 | #define DECLARE_SCC_DEV(name_str) \ | 721 | #define DECLARE_SCC_DEV(name_str) \ |
720 | { \ | 722 | { \ |
721 | .name = name_str, \ | 723 | .name = name_str, \ |
722 | .init_iops = init_iops_scc, \ | 724 | .init_iops = init_iops_scc, \ |
723 | .init_hwif = init_hwif_scc, \ | 725 | .init_hwif = init_hwif_scc, \ |
726 | .port_ops = &scc_port_ops, \ | ||
724 | .host_flags = IDE_HFLAG_SINGLE, \ | 727 | .host_flags = IDE_HFLAG_SINGLE, \ |
725 | .pio_mask = ATA_PIO4, \ | 728 | .pio_mask = ATA_PIO4, \ |
726 | } | 729 | } |