aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.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/ide-dma.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/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 8757e5ef6c95..dc4bc06f9871 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -574,6 +574,7 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode)
574{ 574{
575 struct hd_driveid *id = drive->id; 575 struct hd_driveid *id = drive->id;
576 ide_hwif_t *hwif = drive->hwif; 576 ide_hwif_t *hwif = drive->hwif;
577 const struct ide_port_ops *port_ops = hwif->port_ops;
577 unsigned int mask = 0; 578 unsigned int mask = 0;
578 579
579 switch(base) { 580 switch(base) {
@@ -581,8 +582,8 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode)
581 if ((id->field_valid & 4) == 0) 582 if ((id->field_valid & 4) == 0)
582 break; 583 break;
583 584
584 if (hwif->udma_filter) 585 if (port_ops && port_ops->udma_filter)
585 mask = hwif->udma_filter(drive); 586 mask = port_ops->udma_filter(drive);
586 else 587 else
587 mask = hwif->ultra_mask; 588 mask = hwif->ultra_mask;
588 mask &= id->dma_ultra; 589 mask &= id->dma_ultra;
@@ -598,8 +599,8 @@ static unsigned int ide_get_mode_mask(ide_drive_t *drive, u8 base, u8 req_mode)
598 case XFER_MW_DMA_0: 599 case XFER_MW_DMA_0:
599 if ((id->field_valid & 2) == 0) 600 if ((id->field_valid & 2) == 0)
600 break; 601 break;
601 if (hwif->mdma_filter) 602 if (port_ops && port_ops->mdma_filter)
602 mask = hwif->mdma_filter(drive); 603 mask = port_ops->mdma_filter(drive);
603 else 604 else
604 mask = hwif->mwdma_mask; 605 mask = hwif->mwdma_mask;
605 mask &= id->dma_mword; 606 mask &= id->dma_mword;