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/triflex.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/triflex.c')
-rw-r--r-- | drivers/ide/pci/triflex.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/ide/pci/triflex.c b/drivers/ide/pci/triflex.c index 3316b197c779..db65a558d4ec 100644 --- a/drivers/ide/pci/triflex.c +++ b/drivers/ide/pci/triflex.c | |||
@@ -87,16 +87,15 @@ static void triflex_set_pio_mode(ide_drive_t *drive, const u8 pio) | |||
87 | triflex_set_mode(drive, XFER_PIO_0 + pio); | 87 | triflex_set_mode(drive, XFER_PIO_0 + pio); |
88 | } | 88 | } |
89 | 89 | ||
90 | static void __devinit init_hwif_triflex(ide_hwif_t *hwif) | 90 | static const struct ide_port_ops triflex_port_ops = { |
91 | { | 91 | .set_pio_mode = triflex_set_pio_mode, |
92 | hwif->set_pio_mode = &triflex_set_pio_mode; | 92 | .set_dma_mode = triflex_set_mode, |
93 | hwif->set_dma_mode = &triflex_set_mode; | 93 | }; |
94 | } | ||
95 | 94 | ||
96 | static const struct ide_port_info triflex_device __devinitdata = { | 95 | static const struct ide_port_info triflex_device __devinitdata = { |
97 | .name = "TRIFLEX", | 96 | .name = "TRIFLEX", |
98 | .init_hwif = init_hwif_triflex, | ||
99 | .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, | 97 | .enablebits = {{0x80, 0x01, 0x01}, {0x80, 0x02, 0x02}}, |
98 | .port_ops = &triflex_port_ops, | ||
100 | .pio_mask = ATA_PIO4, | 99 | .pio_mask = ATA_PIO4, |
101 | .swdma_mask = ATA_SWDMA2, | 100 | .swdma_mask = ATA_SWDMA2, |
102 | .mwdma_mask = ATA_MWDMA2, | 101 | .mwdma_mask = ATA_MWDMA2, |