diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 22:25:14 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 22:25:14 +0200 |
commit | ac95beedf8bc97b24f9540d4da9952f07221c023 (patch) | |
tree | c29837142c8083b6fcaf1767abcb0a4533676cd1 /drivers/ide/pci/cs5520.c | |
parent | 4a27214d7be31e122db4102166f49ec15958e8e9 (diff) | |
download | linux-stable-ac95beedf8bc97b24f9540d4da9952f07221c023.tar.gz linux-stable-ac95beedf8bc97b24f9540d4da9952f07221c023.tar.bz2 linux-stable-ac95beedf8bc97b24f9540d4da9952f07221c023.zip |
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/cs5520.c')
-rw-r--r-- | drivers/ide/pci/cs5520.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c index 01b37ecb5a5a..41559c6de0ca 100644 --- a/drivers/ide/pci/cs5520.c +++ b/drivers/ide/pci/cs5520.c @@ -105,19 +105,22 @@ static void cs5520_dma_host_set(ide_drive_t *drive, int on) static void __devinit init_hwif_cs5520(ide_hwif_t *hwif) { - hwif->set_pio_mode = &cs5520_set_pio_mode; - hwif->set_dma_mode = &cs5520_set_dma_mode; - if (hwif->dma_base == 0) return; hwif->dma_host_set = &cs5520_dma_host_set; } +static const struct ide_port_ops cs5520_port_ops = { + .set_pio_mode = cs5520_set_pio_mode, + .set_dma_mode = cs5520_set_dma_mode, +}; + #define DECLARE_CS_DEV(name_str) \ { \ .name = name_str, \ .init_hwif = init_hwif_cs5520, \ + .port_ops = &cs5520_port_ops, \ .host_flags = IDE_HFLAG_ISA_PORTS | \ IDE_HFLAG_CS5520 | \ IDE_HFLAG_VDMA | \ |