aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/alim15x3.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:14 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:14 -0400
commitac95beedf8bc97b24f9540d4da9952f07221c023 (patch)
treec29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/pci/alim15x3.c
parent4a27214d7be31e122db4102166f49ec15958e8e9 (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/alim15x3.c')
-rw-r--r--drivers/ide/pci/alim15x3.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 3fa2d9f7b1b2..ec9fba8ad342 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -610,7 +610,7 @@ static int ali_cable_override(struct pci_dev *pdev)
610} 610}
611 611
612/** 612/**
613 * ata66_ali15x3 - check for UDMA 66 support 613 * ali_cable_detect - cable detection
614 * @hwif: IDE interface 614 * @hwif: IDE interface
615 * 615 *
616 * This checks if the controller and the cable are capable 616 * This checks if the controller and the cable are capable
@@ -620,7 +620,7 @@ static int ali_cable_override(struct pci_dev *pdev)
620 * FIXME: frobs bits that are not defined on newer ALi devicea 620 * FIXME: frobs bits that are not defined on newer ALi devicea
621 */ 621 */
622 622
623static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif) 623static u8 __devinit ali_cable_detect(ide_hwif_t *hwif)
624{ 624{
625 struct pci_dev *dev = to_pci_dev(hwif->dev); 625 struct pci_dev *dev = to_pci_dev(hwif->dev);
626 unsigned long flags; 626 unsigned long flags;
@@ -661,12 +661,6 @@ static u8 __devinit ata66_ali15x3(ide_hwif_t *hwif)
661 661
662static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) 662static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif)
663{ 663{
664 hwif->set_pio_mode = &ali_set_pio_mode;
665 hwif->set_dma_mode = &ali_set_dma_mode;
666 hwif->udma_filter = &ali_udma_filter;
667
668 hwif->cable_detect = ata66_ali15x3;
669
670 if (hwif->dma_base == 0) 664 if (hwif->dma_base == 0)
671 return; 665 return;
672 666
@@ -745,11 +739,19 @@ static void __devinit init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase)
745 ide_setup_dma(hwif, dmabase); 739 ide_setup_dma(hwif, dmabase);
746} 740}
747 741
742static const struct ide_port_ops ali_port_ops = {
743 .set_pio_mode = ali_set_pio_mode,
744 .set_dma_mode = ali_set_dma_mode,
745 .udma_filter = ali_udma_filter,
746 .cable_detect = ali_cable_detect,
747};
748
748static const struct ide_port_info ali15x3_chipset __devinitdata = { 749static const struct ide_port_info ali15x3_chipset __devinitdata = {
749 .name = "ALI15X3", 750 .name = "ALI15X3",
750 .init_chipset = init_chipset_ali15x3, 751 .init_chipset = init_chipset_ali15x3,
751 .init_hwif = init_hwif_ali15x3, 752 .init_hwif = init_hwif_ali15x3,
752 .init_dma = init_dma_ali15x3, 753 .init_dma = init_dma_ali15x3,
754 .port_ops = &ali_port_ops,
753 .pio_mask = ATA_PIO5, 755 .pio_mask = ATA_PIO5,
754 .swdma_mask = ATA_SWDMA2, 756 .swdma_mask = ATA_SWDMA2,
755 .mwdma_mask = ATA_MWDMA2, 757 .mwdma_mask = ATA_MWDMA2,